]> xenbits.xensource.com Git - libvirt.git/commitdiff
bridge: Fix generation of dnsmasq's --dhcp-hostsfile option
authorKay Schubert <kayegypt@web.de>
Thu, 6 Jan 2011 08:14:58 +0000 (09:14 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 6 Jan 2011 14:58:23 +0000 (15:58 +0100)
I added a host definition to a network definition:

<network>
  <name>Lokal</name>
  <uuid>2074f379-b82c-423f-9ada-305d8088daaa</uuid>
  <bridge name='virbr1' stp='on' delay='0' />
  <ip address='192.168.180.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.180.128' end='192.168.180.254' />
      <host mac='23:74:00:03:42:02' name='somevm' ip='192.168.180.10' />
    </dhcp>
  </ip>
</network>

But due to the wrong if-statement the argument --dhcp-hostsfile doesn't get
added to the dnsmasq command. The patch below fixes it for me.

AUTHORS
src/network/bridge_driver.c

diff --git a/AUTHORS b/AUTHORS
index b204bd6e095c791a87adf0636979e85ca46fa739..721b8f827c370e824ca16383cd4f9f428e7301de 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -142,6 +142,7 @@ Patches have also been contributed by:
   Josh Durgin          <joshd@hq.newdream.net>
   Roopa Prabhu         <roprabhu@cisco.com>
   Paweł Krześniak      <pawel.krzesniak@gmail.com>
+  Kay Schubert         <kayegypt@web.de>
 
   [....send patches to get your name here....]
 
index 7d43ef59cec89a00efa5d2eb2a2217179cdbce81..4c64a7464377b0223988e8a794b04d05cc28f1b9 100644 (file)
@@ -524,7 +524,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
             goto cleanup;
         }
 
-        if (networkSaveDnsmasqHostsfile(ipdef, dctx, false) < 0) {
+        if (networkSaveDnsmasqHostsfile(ipdef, dctx, false) == 0) {
             virCommandAddArgPair(cmd, "--dhcp-hostsfile",
                                  dctx->hostsfile->path);
         }