[libvirt] [PATCH] Drop empty argument from dnsmasq call

Eric Blake eblake at redhat.com
Fri Feb 18 18:37:53 UTC 2011


On 02/18/2011 11:32 AM, Eric Blake wrote:

Oops - I sent my initial reply without finishing reading your patch.

> ./src/option.c:    {"pid-file", 2, 0, 'x'},

But your patch was about conf-file.  Thankfully:

./src/option.c:    {"conf-file", 2, 0, 'C'},

so the same arguments apply.

> --pid-file
> --pid-file=
> -x
> 
> specify no pid file,

Actually, with getopt_long(), --pid-file and -x set the optional
argument to NULL, while --pid-file= sets the optional argument to the
empty string.  Depending on the rest of the program, that slight
difference could have an impact, so we'd better stick with the same form
of --pid-file=.

> 
> Therefore, ACK to this patch.

Actually, I have a nit; could you please fix it first?

> +++ b/src/network/bridge_driver.c
> @@ -477,7 +477,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
>      virCommandAddArgPair(cmd, "--pid-file", pidfile);
>  
>      /* *no* conf file */
> -    virCommandAddArgList(cmd, "--conf-file=", "", NULL);
> +    virCommandAddArgList(cmd, "--conf-file=", NULL);

This might as well be the shorter (and faster):

virCommandAddArg(cmd, "--conf-file=");

now that it is only one argument.

-- 
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/20110218/adeaf9c6/attachment-0001.sig>


More information about the libvir-list mailing list