Re: [PATCH v2 4/6] vfio: selftests: Export more vfio_pci functions
From: Raghavendra Rao Ananta
Date: Thu Jan 08 2026 - 16:48:30 EST
On Wed, Jan 7, 2026 at 3:05 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
>
> On 2025-12-10 06:14 PM, Raghavendra Rao Ananta wrote:
>
> > -static void vfio_device_bind_iommufd(int device_fd, int iommufd,
> > - const char *vf_token)
> > +int __vfio_device_bind_iommufd(int device_fd, int iommufd, const char *vf_token)
> > {
> > struct vfio_device_bind_iommufd args = {
> > .argsz = sizeof(args),
> > @@ -314,7 +322,15 @@ static void vfio_device_bind_iommufd(int device_fd, int iommufd,
> > args.token_uuid_ptr = (u64)token_uuid;
> > }
> >
> > - ioctl_assert(device_fd, VFIO_DEVICE_BIND_IOMMUFD, &args);
> > + return ioctl(device_fd, VFIO_DEVICE_BIND_IOMMUFD, &args);
>
> For ioctls that return 0 on success and -1 on error, let's follow the
> precedent set in iommu.c and return -errno on error from our library
> functions. i.e.
>
> if (ioctl(device_fd, VFIO_DEVICE_BIND_IOMMUFD, &args))
> return -errno;
>
> return 0;
Sure, will take care of this in v3.