]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: backend for virNetworkUpdate of dhcp range
authorLaine Stump <laine@laine.org>
Fri, 21 Sep 2012 02:25:40 +0000 (22:25 -0400)
committerDaniel Veillard <veillard@redhat.com>
Fri, 21 Sep 2012 03:54:16 +0000 (11:54 +0800)
commit1100f61074b9024fbbc5fb548392fbc99e9e5ca4
tree471bf2ba55c1fdb4c2f85a6b9ff0d172704b5a4e
parentfe7872827f0451fcc8f6618269f5ed13a2feeb67
network: backend for virNetworkUpdate of dhcp range

The dhcp range element is contained in the <dhcp> element of one of a
network's <ip> elements. There can be multiple <range>
elements. Because there are only two attributes (start and end), and
those are exactly what you would use to identify a particular range,
it doesn't really make sense to modify an existing element, so
VIR_NETWORK_UPDATE_COMMAND_MODIFY isn't supported for this section,
only ADD_FIRST, ADD_LAST, and DELETE.

Since virsh already has support for understanding all the defined
sections, this new backend is automatically supported by virsh. You
would use it like this:

  virsh net-update mynet add ip-dhcp-range \
        "<range start='1.2.3.4' end='1.2.3.20'/>" --live --config

The bridge driver also already supports all sections, so it's doing
the correct thing in this case as well - since the dhcp range is
placed on the dnsmasq commandline, the bridge driver recreates the
dnsmasq commandline, and re-runs dnsmasq whenever a range is
added/deleted (and AFFECT_LIVE is specified in the flags).
src/conf/network_conf.c