vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev
authorJoao Martins <joao.m.martins@oracle.com>
Fri, 19 Jul 2024 12:04:50 +0000 (13:04 +0100)
committerCédric Le Goater <clg@redhat.com>
Tue, 23 Jul 2024 15:14:52 +0000 (17:14 +0200)
commit9f17604195c03580b16c3cc5631c86f3894dd442
treeb27aff2834c9ce2e9914b6cf3373da2130e1ebac
parent13e522f644e2b15fa857028a33e6a3b75e45158d
vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev

mdevs aren't "physical" devices and when asking for backing IOMMU info, it
fails the entire provisioning of the guest. Fix that by skipping
HostIOMMUDevice initialization in the presence of mdevs, and skip setting
an iommu device when it is known to be an mdev.

Cc: Zhenzhong Duan <zhenzhong.duan@intel.com>
Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler")
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
hw/vfio/common.c
hw/vfio/pci.c