]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
network: fix (non)update of dnsmasq config during virDomainUpdateDeviceFlags
authorLaine Stump <laine@laine.org>
Fri, 14 Dec 2012 17:44:03 +0000 (12:44 -0500)
committerLaine Stump <laine@laine.org>
Fri, 14 Dec 2012 18:37:17 +0000 (13:37 -0500)
A forgotten "!" in recently-modified code at the top of
networkRefreshDaemon() meant an improper early return, which led to 1)
dnsmasq config files not being updated from the newly modified config,
and 2) dnsmasq not being sent a SIGHUP so that it could learn about
the changes to the config.

virNetworkDefGetIpByIndex() returns NULL if there are no ip objects of
the requested type, and if there are no IP elements, then dnsmasq
shouldn't be running, so we can return early. Otherwise we should
rewrite the config files and send a SIGHUP.

src/network/bridge_driver.c

index a32755d7ab57e5d6798ab2121dce89b70601c33e..c62e72970e61c5029da018dc69ba168e0a303664 100644 (file)
@@ -1123,7 +1123,7 @@ networkRefreshDhcpDaemon(struct network_driver *driver,
     dnsmasqContext *dctx = NULL;
 
     /* if no IP addresses specified, nothing to do */
-    if (virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, 0))
+    if (!virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, 0))
         return 0;
 
     /* if there's no running dnsmasq, just start it */