[libvirt] [PATCH] network: Add a missing check in bridge_driver.c

Michal Privoznik mprivozn at redhat.com
Tue Oct 22 16:21:21 UTC 2013


On 22.10.2013 14:38, Hongwei Bi wrote:
> Signed-off-by: Hongwei Bi <hwbi2008 at gmail.com>
> ---
>  src/network/bridge_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 8787bdb..73375f0 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -1107,7 +1107,8 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr driver,
>      if (dctx == NULL)
>          goto cleanup;
>  
> -    dnsmasqCapsRefresh(&driver->dnsmasqCaps, false);
> +    if (dnsmasqCapsRefresh(&driver->dnsmasqCaps, false) < 0)
> +	goto cleanup;

s/\t/<spaces>/

(make syntax-check would spot that)

Moreover, if you're touching this, s/false/NULL/ as the last argument is
'const char *' anyway. It seems a bit odd passing 'false' there.

So I'm squashing this in:

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 73375f0..3ce3130 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1107,8 +1107,8 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr
driver,
     if (dctx == NULL)
         goto cleanup;

-    if (dnsmasqCapsRefresh(&driver->dnsmasqCaps, false) < 0)
-       goto cleanup;
+    if (dnsmasqCapsRefresh(&driver->dnsmasqCaps, NULL) < 0)
+        goto cleanup;

     ret = networkBuildDhcpDaemonCommandLine(network, &cmd, pidfile,
                                             dctx, driver->dnsmasqCaps);

I've extended the commit message, ACKed and pushed.

Michal




More information about the libvir-list mailing list