diff options
author | Eric Auger <eric.auger@redhat.com> | 2024-06-14 11:52:51 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2024-06-24 23:15:30 +0200 |
commit | dc169694cad4b4c4028c755ec44ebb7565bd7461 (patch) | |
tree | 3d0505291c7ad55ca4efca15e8d403d623502ee2 /hw/vfio | |
parent | 77f6efc0ab93718da2bc3f908b7ff7fffa489ea1 (diff) | |
download | qemu-dc169694cad4b4c4028c755ec44ebb7565bd7461.zip qemu-dc169694cad4b4c4028c755ec44ebb7565bd7461.tar.gz qemu-dc169694cad4b4c4028c755ec44ebb7565bd7461.tar.bz2 |
HostIOMMUDevice: Store the VFIO/VDPA agent
Store the agent device (VFIO or VDPA) in the host IOMMU device.
This will allow easy access to some of its resources.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/container.c | 1 | ||||
-rw-r--r-- | hw/vfio/iommufd.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 26e6f7f..b728b97 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -1145,6 +1145,7 @@ static bool hiod_legacy_vfio_realize(HostIOMMUDevice *hiod, void *opaque, hiod->name = g_strdup(vdev->name); hiod->caps.aw_bits = vfio_device_get_aw_bits(vdev); + hiod->agent = opaque; return true; } diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 409ed3d..dbdae1a 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -631,6 +631,8 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque, struct iommu_hw_info_vtd vtd; } data; + hiod->agent = opaque; + if (!iommufd_backend_get_device_info(vdev->iommufd, vdev->devid, &type, &data, sizeof(data), errp)) { return false; |