提交 a43c7338 编写于 作者: K Kay Schubert 提交者: Jiri Denemark

bridge: Fix generation of dnsmasq's --dhcp-hostsfile option

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.
上级 4684f478
...@@ -142,6 +142,7 @@ Patches have also been contributed by: ...@@ -142,6 +142,7 @@ Patches have also been contributed by:
Josh Durgin <joshd@hq.newdream.net> Josh Durgin <joshd@hq.newdream.net>
Roopa Prabhu <roprabhu@cisco.com> Roopa Prabhu <roprabhu@cisco.com>
Paweł Krześniak <pawel.krzesniak@gmail.com> Paweł Krześniak <pawel.krzesniak@gmail.com>
Kay Schubert <kayegypt@web.de>
[....send patches to get your name here....] [....send patches to get your name here....]
......
...@@ -524,7 +524,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, ...@@ -524,7 +524,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
goto cleanup; goto cleanup;
} }
if (networkSaveDnsmasqHostsfile(ipdef, dctx, false) < 0) { if (networkSaveDnsmasqHostsfile(ipdef, dctx, false) == 0) {
virCommandAddArgPair(cmd, "--dhcp-hostsfile", virCommandAddArgPair(cmd, "--dhcp-hostsfile",
dctx->hostsfile->path); dctx->hostsfile->path);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册