[Kimchi-devel] [PATCH] [Kimchi] Check if VM is off before detaching multifn PCI

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Wed Aug 24 16:57:58 UTC 2016


 - this commit fix a bug when detaching multifunction pci devices
   because hotplug/coldplug need a different approach with
   libvirt upstream.

Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
 model/vmhostdevs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/model/vmhostdevs.py b/model/vmhostdevs.py
index ef39de3..e2299e2 100644
--- a/model/vmhostdevs.py
+++ b/model/vmhostdevs.py
@@ -686,6 +686,9 @@ class VMHostDevModel(object):
         return devices
 
     def _hotunplug_multifunction_pci(self, dom, hostdev, dev_name):
+        if DOM_STATE_MAP[dom.info()[0]] == "shutoff":
+            return False
+
         domain, bus, slot, _ = dev_name.split('_')[1:]
         # get all devices attached to the guest in the same domain+bus+slot
         # that the one we are going to detach because they must be detached
-- 
2.7.4




More information about the Kimchi-devel mailing list