On Fri, May 30, 2025 at 05:35:11PM +0800, Zhenzhong Duan wrote: > Implement [at|de]tach_hwpt handlers in VFIO subsystem. vIOMMU > utilizes them to attach to or detach from hwpt on host side. > > Signed-off-by: Yi Liu <yi.l....@intel.com> > Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com> > Reviewed-by: Cédric Le Goater <c...@redhat.com>
Reviewed-by: Nicolin Chen <nicol...@nvidia.com> > +static bool > +host_iommu_device_iommufd_vfio_attach_hwpt(HostIOMMUDeviceIOMMUFD *idev, > + uint32_t hwpt_id, Error **errp) > +{ > + VFIODevice *vbasedev = HOST_IOMMU_DEVICE(idev)->agent; > + > + return !iommufd_cdev_attach_ioas_hwpt(vbasedev, hwpt_id, errp); > +} > + > +static bool > +host_iommu_device_iommufd_vfio_detach_hwpt(HostIOMMUDeviceIOMMUFD *idev, > + Error **errp) > +{ > + VFIODevice *vbasedev = HOST_IOMMU_DEVICE(idev)->agent; > + > + return iommufd_cdev_detach_ioas_hwpt(vbasedev, errp); > +} Could be a separate patch though: So, we have the attach API returning "int" while the detach API returning "bool". Is errno returned back to the attach caller(s) so the attach API can be a "bool" type too? Nicolin