libvirt/tests/networkxml2argvdata
Laine Stump 1cb1f9dabf network: always create dnsmasq hosts and addnhosts files, even if empty
This fixes the problem reported in:

  https://bugzilla.redhat.com/show_bug.cgi?id=868389

Previously, the dnsmasq hosts file (used for static dhcp entries, and
addnhosts file (used for additional dns host entries) were only
created/referenced on the dnsmasq commandline if there was something
to put in them at the time the network was started. Once we can update
a network definition while it's active (which is now possible with
virNetworkUpdate), this is no longer a valid strategy - if there were
0 dhcp static hosts (resulting in no reference to the hosts file on the
commandline), then one was later added, the commandline wouldn't have
linked dnsmasq up to the file, so even though we create it, dnsmasq
doesn't pay any attention.

The solution is to just always create these files and reference them
on the dnsmasq commandline (almost always, anyway). That way dnsmasq
can notice when a new entry is added at runtime (a SIGHUP is sent to
dnsmasq by virNetworkUdpate whenever a host entry is added or removed)

The exception to this is that the dhcp static hosts file isn't created
if there are no lease ranges *and* no static hosts. This is because in
this case dnsmasq won't be setup to listen for dhcp requests anyway -
in that case, if the count of dhcp hosts goes from 0 to 1, dnsmasq
will need to be restarted anyway (to get it listening on the dhcp
port). Likewise, if the dhcp hosts count goes from 1 to 0 (and there
are no dhcp ranges) we need to restart dnsmasq so that it will stop
listening on port 67. These special situations are handled in the
bridge driver's networkUpdate() by checking for ((bool)
nranges||nhosts) both before and after the update, and triggering a
dnsmasq restart if the before and after don't match.
2012-10-20 21:29:19 -04:00
..
isolated-network.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
isolated-network.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00
nat-network-dns-hosts.argv remove dnsmasq command line parameter "--filterwin2k" 2012-09-06 10:59:33 -06:00
nat-network-dns-hosts.xml network: add domain to unqualified names defined with <host> 2011-06-28 12:57:14 -04:00
nat-network-dns-srv-record-minimal.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
nat-network-dns-srv-record-minimal.xml Implement DNS SRV record into the bridge driver 2012-01-02 23:05:55 +08:00
nat-network-dns-srv-record.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
nat-network-dns-srv-record.xml Implement DNS SRV record into the bridge driver 2012-01-02 23:05:55 +08:00
nat-network-dns-txt-record.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
nat-network-dns-txt-record.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00
nat-network.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
nat-network.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00
netboot-network.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
netboot-network.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00
netboot-proxy-network.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
netboot-proxy-network.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00
routed-network.argv network: always create dnsmasq hosts and addnhosts files, even if empty 2012-10-20 21:29:19 -04:00
routed-network.xml Network: Add regression tests for the command-line arguments 2011-06-24 16:15:27 -04:00