[Kimchi-devel] [PATCH] Add vfio driver as default for ppc systems.

Aline Manera alinefm at linux.vnet.ibm.com
Fri May 22 15:14:17 UTC 2015



On 21/05/2015 17:19, Jose Ricardo Ziviani wrote:
>   - ppc hotplug does not work with kvm driver, it must be
>     vfio by default.
>
> Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
> ---
>   src/kimchi/model/vmhostdevs.py | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/kimchi/model/vmhostdevs.py b/src/kimchi/model/vmhostdevs.py
> index 964ec49..31e0b92 100644
> --- a/src/kimchi/model/vmhostdevs.py
> +++ b/src/kimchi/model/vmhostdevs.py
> @@ -31,6 +31,7 @@ from kimchi.model.utils import get_vm_config_flag
>   from kimchi.model.vms import DOM_STATE_MAP, VMModel
>   from kimchi.rollbackcontext import RollbackContext
>   from kimchi.utils import kimchi_log, run_command
> +import platform
>
>
>   class VMHostDevsModel(object):
> @@ -164,6 +165,10 @@ class VMHostDevsModel(object):
>           driver = ('vfio' if DOM_STATE_MAP[dom.info()[0]] == "shutoff" and
>                     self.caps.kernel_vfio else 'kvm')
>
> +        # on ppc systems it must be vfio driver.
> +        if platform.machine().startswith('ppc'):
> +            driver = 'vfio'
> +

Do you mean it should be vfio even when VM is running?

self.caps.kernel_vfio checks the vfio module is loaded otherwise we 
should not use it.

So if the goal of this patch is allow hot plug with vfio I suggest 
change the if conditional above to:

driver = ('vfio' if self.caps.kernel_cfio else 'kvm')

>           # Attach all PCI devices in the same IOMMU group
>           dev_model = DeviceModel(conn=self.conn)
>           devs_model = DevicesModel(conn=self.conn)




More information about the Kimchi-devel mailing list