On 5/28/25 08:04, Zhenzhong Duan wrote:
> There are three iommufd specific members in HostIOMMUDeviceIOMMUFD
> that need to be initialized after attachment, they will all be used
> by vIOMMU.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/vfio/iommufd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index af1c7ab10a..5fde2b633a 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -814,6 +814,7 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque,
> Error **errp)
> {
> VFIODevice *vdev = opaque;
> + HostIOMMUDeviceIOMMUFD *idev;
> HostIOMMUDeviceCaps *caps = &hiod->caps;
> enum iommu_hw_info_type type;
> union {
> @@ -833,6 +834,11 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque,
> caps->type = type;
> caps->hw_caps = hw_caps;
>
> + idev = HOST_IOMMU_DEVICE_IOMMUFD(hiod);
> + idev->iommufd = vdev->iommufd;
> + idev->devid = vdev->devid;
> + idev->hwpt_id = vdev->hwpt->hwpt_id;
> +
> return true;
> }
>