diff options
-rw-r--r-- | nova/tests/fakelibvirt.py | 2 | ||||
-rw-r--r-- | nova/virt/libvirt/driver.py | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/nova/tests/fakelibvirt.py b/nova/tests/fakelibvirt.py index 4350a8878..369b468b8 100644 --- a/nova/tests/fakelibvirt.py +++ b/nova/tests/fakelibvirt.py @@ -68,6 +68,8 @@ VIR_DOMAIN_SHUTDOWN = 4 VIR_DOMAIN_SHUTOFF = 5 VIR_DOMAIN_CRASHED = 6 +VIR_DOMAIN_XML_SECURE = 1 + VIR_CPU_COMPARE_ERROR = -1 VIR_CPU_COMPARE_INCOMPATIBLE = 0 VIR_CPU_COMPARE_IDENTICAL = 1 diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 96ae61d70..1ff41ef4e 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -616,6 +616,13 @@ class LibvirtDriver(driver.ComputeDriver): raise exception.DeviceIsBusy(device=mount_device) raise + # TODO(danms) once libvirt has support for LXC hotplug, + # replace this re-define with use of the + # VIR_DOMAIN_AFFECT_LIVE & VIR_DOMAIN_AFFECT_CONFIG flags with + # attachDevice() + domxml = virt_dom.XMLDesc(libvirt.VIR_DOMAIN_XML_SECURE) + self._conn.defineXML(domxml) + @staticmethod def _get_disk_xml(xml, device): """Returns the xml for the disk mounted at device""" @@ -650,6 +657,13 @@ class LibvirtDriver(driver.ComputeDriver): connection_info, mount_device) + # TODO(danms) once libvirt has support for LXC hotplug, + # replace this re-define with use of the + # VIR_DOMAIN_AFFECT_LIVE & VIR_DOMAIN_AFFECT_CONFIG flags with + # detachDevice() + domxml = virt_dom.XMLDesc(libvirt.VIR_DOMAIN_XML_SECURE) + self._conn.defineXML(domxml) + @exception.wrap_exception() def _attach_lxc_volume(self, xml, virt_dom, instance_name): LOG.info(_('attaching LXC block device')) |