>From 46b70312e064a748400b6d5afeeb040a941a07b3 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Fri, 10 Dec 2010 15:49:37 -0500 Subject: [PATCH] Combine multiple consecutive virCommandAddArg calls into virCommandAddArgList --- src/network/bridge_driver.c | 27 +++++++++++---------------- 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 9802222..c3f32d7 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -421,19 +421,15 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, * Needed to ensure dnsmasq uses same algorithm for processing * multiple namedriver entries in /etc/resolv.conf as GLibC. */ - virCommandAddArg(cmd, "--strict-order"); - virCommandAddArg(cmd, "--bind-interfaces"); + virCommandAddArgList(cmd, "--strict-order", "--bind-interfaces", NULL); - if (network->def->domain) { - virCommandAddArg(cmd, "--domain"); - virCommandAddArg(cmd, network->def->domain); - } + if (network->def->domain) + virCommandAddArgList(cmd, "--domain", network->def->domain, NULL); virCommandAddArgPair(cmd, "--pid-file", pidfile); /* *no* conf file */ - virCommandAddArg(cmd, "--conf-file="); - virCommandAddArg(cmd, ""); + virCommandAddArgList(cmd, "--conf-file=", "", NULL); /* * XXX does not actually work, due to some kind of @@ -444,11 +440,10 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, * virCommandAddArg(cmd, "--interface"); * virCommandAddArg(cmd, network->def->bridge); */ - virCommandAddArg(cmd, "--listen-address"); - virCommandAddArg(cmd, bridgeaddr); - - virCommandAddArg(cmd, "--except-interface"); - virCommandAddArg(cmd, "lo"); + virCommandAddArgList(cmd, + "--listen-address", bridgeaddr, + "--except-interface", "lo", + NULL); for (r = 0 ; r < network->def->nranges ; r++) { char *saddr = virSocketFormatAddr(&network->def->ranges[r].start); @@ -500,9 +495,9 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, } if (network->def->tftproot) { - virCommandAddArg(cmd, "--enable-tftp"); - virCommandAddArg(cmd, "--tftp-root"); - virCommandAddArg(cmd, network->def->tftproot); + virCommandAddArgList(cmd, "--enable-tftp", + "--tftp-root", network->def->tftproot, + NULL); } if (network->def->bootfile) { -- 1.7.3.2