[PATCH rfcv2 09/18] vfio/pci: Initialize host iommu device instance after attachment

Zhenzhong Duan posted 18 patches 1 year, 3 months ago
There is a newer version of this series
[PATCH rfcv2 09/18] vfio/pci: Initialize host iommu device instance after attachment
Posted by Zhenzhong Duan 1 year, 3 months ago
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 hw/vfio/pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index d1e1b8cb89..dedb64fc08 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3006,6 +3006,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
         goto error;
     }
 
+    /* Initialize host iommu device after attachment succeed */
+    host_iommu_device_init(vbasedev);
+
     vfio_populate_device(vdev, &err);
     if (err) {
         error_propagate(errp, err);
-- 
2.34.1