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

- 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@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

Reviewed-By: Ramon Medeiros <ramonn@br.ibm.com> On 08/24/2016 01:57 PM, Jose Ricardo Ziviani wrote:
- 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@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
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Jose Ricardo Ziviani
-
Ramon Medeiros