[libvirt] [PATCH] network: fix (non)update of dnsmasq config during virDomainUpdateDeviceFlags

Eric Blake eblake at redhat.com
Fri Dec 14 18:01:00 UTC 2012


On 12/14/2012 10:50 AM, Laine Stump wrote:
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK.  You probably spent more time chasing the cause than actually
fixing the one line :)

> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index a32755d..c62e729 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -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 */
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
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/20121214/049d5da7/attachment-0001.sig>


More information about the libvir-list mailing list