[libvirt] [PATCH 01/16] remote_driver: Convert virExecDaemonize usage to virCommand

Eric Blake eblake at redhat.com
Tue May 10 22:57:55 UTC 2011


On 05/10/2011 02:07 PM, Cole Robinson wrote:
> And drop the now unused virExecDaemonize
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/libvirt_private.syms   |    1 -
>  src/remote/remote_driver.c |   18 ++++++-----
>  src/util/util.c            |   73 +-------------------------------------------
>  src/util/util.h            |    9 -----
>  4 files changed, 11 insertions(+), 90 deletions(-)

Cool 1:9 patch ratio.  And thanks for tackling this series!  It's been a
low-priority todo on my plate for some time, now.

> @@ -326,8 +327,8 @@ static int
>  remoteForkDaemon(void)
>  {
>      const char *daemonPath = remoteFindDaemonPath();
> -    const char *const daemonargs[] = { daemonPath, "--timeout=30", NULL };
> -    pid_t pid;
> +    virCommandPtr cmd = NULL;
> +    int ret;
>  
>      if (!daemonPath) {
>          remoteError(VIR_ERR_INTERNAL_ERROR, "%s",
> @@ -335,13 +336,14 @@ remoteForkDaemon(void)
>          return -1;
>      }
>  
> -    if (virExecDaemonize(daemonargs, NULL, NULL,
> -                         &pid, -1, NULL, NULL,
> -                         VIR_EXEC_CLEAR_CAPS,
> -                         NULL, NULL, NULL) < 0)
> -        return -1;
> +    cmd = virCommandNewArgList(daemonPath, "--timeout", "30", NULL);

The documented preference for long options with arguments is "--a=b" as
one argv, rather than "--a" "b" as two argv, but both work, so I'm fine
with that change.

ACK.

-- 
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/20110510/28b3f1d4/attachment-0001.sig>


More information about the libvir-list mailing list