eb8a447
From: Cole Robinson <crobinso@redhat.com>
eb8a447
Date: Mon, 10 Aug 2015 18:30:12 -0400
eb8a447
Subject: [PATCH virt-manager] domain: Use UpdateDevice for CDROM media change
eb8a447
 (bz 1229819)
eb8a447
eb8a447
This has been supported for a long time now, and is more tested these
eb8a447
days, so let's use it rather than the old style AttachDevice method
eb8a447
eb8a447
It also works around a libvirt issue described in bz 1229819
eb8a447
eb8a447
(cherry picked from commit 40d4c378680275ee432fbf4825c55737bc8c3fc2)
eb8a447
---
eb8a447
 virtManager/domain.py | 16 +++-------------
eb8a447
 1 file changed, 3 insertions(+), 13 deletions(-)
eb8a447
eb8a447
diff --git a/virtManager/domain.py b/virtManager/domain.py
eb8a447
index bb8c511..6668961 100644
eb8a447
--- a/virtManager/domain.py
eb8a447
+++ b/virtManager/domain.py
eb8a447
@@ -799,10 +799,7 @@ class vmmDomain(vmmLibvirtObject):
eb8a447
             _change_bus()
eb8a447
 
eb8a447
         if do_hotplug:
eb8a447
-            hotplug_kwargs = {"device": editdev}
eb8a447
-            if path != _SENTINEL:
eb8a447
-                hotplug_kwargs["storage_path"] = True
eb8a447
-            self.hotplug(**hotplug_kwargs)
eb8a447
+            self.hotplug(device=editdev)
eb8a447
         else:
eb8a447
             self._redefine_xmlobj(xmlobj)
eb8a447
 
eb8a447
@@ -1056,8 +1053,7 @@ class vmmDomain(vmmLibvirtObject):
eb8a447
         self._backend.updateDeviceFlags(xml, flags)
eb8a447
 
eb8a447
     def hotplug(self, vcpus=_SENTINEL, memory=_SENTINEL, maxmem=_SENTINEL,
eb8a447
-        description=_SENTINEL, title=_SENTINEL, storage_path=_SENTINEL,
eb8a447
-        device=_SENTINEL):
eb8a447
+        description=_SENTINEL, title=_SENTINEL, device=_SENTINEL):
eb8a447
         if not self.is_active():
eb8a447
             return
eb8a447
 
eb8a447
@@ -1100,13 +1096,7 @@ class vmmDomain(vmmLibvirtObject):
eb8a447
         if title != _SENTINEL:
eb8a447
             _hotplug_metadata(title, libvirt.VIR_DOMAIN_METADATA_TITLE)
eb8a447
 
eb8a447
-        if storage_path != _SENTINEL:
eb8a447
-            # qemu originally only supported attach_device for updating
eb8a447
-            # a device's path. Stick with that. We may need to differentiate
eb8a447
-            # for other drivers that don't maintain back compat though
eb8a447
-            self.attach_device(device)
eb8a447
-
eb8a447
-        elif device != _SENTINEL:
eb8a447
+        if device != _SENTINEL:
eb8a447
             self._update_device(device)
eb8a447
 
eb8a447