[libvirt] [PATCH 2/1] command: reject pidfile on non-daemon

Eric Blake eblake at redhat.com
Wed Mar 23 21:09:53 UTC 2011


On 03/23/2011 06:24 AM, Daniel P. Berrange wrote:
> On Tue, Mar 22, 2011 at 04:45:08PM -0600, Eric Blake wrote:
>> * src/util/command.c (virCommandRunAsync): Since virExec only
>> creates pidfiles for daemon, enforce this in virCommand.
>> ---
>>  src/util/command.c |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/util/command.c b/src/util/command.c
>> index 89f82c7..7b4337f 100644
>> --- a/src/util/command.c
>> +++ b/src/util/command.c
>> @@ -1172,7 +1172,11 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
>>                          cmd->pwd);
>>          return -1;
>>      }
>> -
>> +    if (cmd->pidfile && !(cmd->flags & VIR_EXEC_DAEMON)) {
>> +        virCommandError(VIR_ERR_INTERNAL_ERROR, "%s",
>> +                        _("creation of pid file requires daemonized command"));
>> +        return -1;
>> +    }
>>
>>      str = virCommandToString(cmd);
>>      VIR_DEBUG("About to run %s", str ? str : cmd->args[0]);
> 
> ACK

Thanks; I've pushed this one.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110323/875a3138/attachment-0001.sig>


More information about the libvir-list mailing list