When you attach a volume to a running instance, only the running
xml is updated in libvirt. This is due to the usage of the
VIRT_DOMAIN_AFFECT_CURRENT flag passed to attach device. What we
really want is to affect both the config and the running xml. There
is no combination of flags that works in all states, so we explicitly
set the right combination of flags depending on the running state
of the vm.
Includes a test to test_virt_drivers to ensure the flags are passed
correctly.
Fixes bug 1071069
Change-Id: I1992748b08daf99cf03dfeb0937ad42457fff1a3