]> xenbits.xensource.com Git - libvirt.git/commit
network: change location of network state xml files
authorLaine Stump <laine@laine.org>
Fri, 4 Apr 2014 13:48:54 +0000 (16:48 +0300)
committerLaine Stump <laine@laine.org>
Sun, 27 Apr 2014 09:19:57 +0000 (12:19 +0300)
commitb9e95491d120d05737b77e2c4dc14ba5dfac5fb0
treea058bd37d10d06925dc070248a80534a92d2aa19
parent8aaa5b68efd58117951d76a67f20798f959a17fa
network: change location of network state xml files

For some reason these have been stored in /var/lib, although other
drivers (e.g. qemu and lxc) store their state files in /var/run.

It's much nicer to store state files in /var/run because it is
automatically cleared out when the system reboots. We can then use
existence of the state file as a convenient indicator of whether or
not a particular network is active.

Since changing the location of the state files by itself will cause
problems in the case of a *live* upgrade from an older libvirt that
uses /var/lib (because current status of active networks will be
lost), the network driver initialization has been modified to migrate
any network state files from /var/lib to /var/run.

This will not help those trying to *downgrade*, but in practice this
will only be problematic in two cases

1) If there are networks with network-wide bandwidth limits configured
   *and in use* by a guest during a downgrade to "old" libvirt. In this
   case, the class ID's used for that network's tc rules, as well as
   the currently in-use bandwidth "floor" will be forgotten.

2) If someone does this: 1) upgrade libvirt, 2) downgrade libvirt, 3)
   modify running state of network (e.g. add a static dhcp host, etc),
   4) upgrade. In this case, the modifications to the running network
   will be lost (but not any persistent changes to the network's
   config).
src/network/bridge_driver.c