Suggested-by: Cédric Le Goater <[email protected]>
Signed-off-by: Zhenzhong Duan <[email protected]>
---
hw/vfio/container.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index 863eec3943..3683487605 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -1164,11 +1164,23 @@ static bool hiod_legacy_vfio_realize(HostIOMMUDevice
*hiod, void *opaque,
return true;
}
+static int hiod_legacy_vfio_check_cap(HostIOMMUDevice *hiod, int cap,
+ Error **errp)
+{
+ switch (cap) {
+ case HOST_IOMMU_DEVICE_CAP_IOMMUFD:
+ return 0;
+ default:
+ return host_iommu_device_check_cap_common(hiod, cap, errp);
+ }
+}
+
static void hiod_legacy_vfio_class_init(ObjectClass *oc, void *data)
{
HostIOMMUDeviceClass *hioc = HOST_IOMMU_DEVICE_CLASS(oc);
hioc->realize = hiod_legacy_vfio_realize;
+ hioc->check_cap = hiod_legacy_vfio_check_cap;
};
static const TypeInfo types[] = {
--
2.34.1