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

Ramon Medeiros ramonn at linux.vnet.ibm.com
Thu Aug 25 20:19:25 UTC 2016


Reviewed-By: Ramon Medeiros <ramonn at 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 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

-- 

Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com




More information about the Kimchi-devel mailing list