Re: [PATCH v2 6/6] vfio: selftests: Add tests to validate SR-IOV UAPI
From: David Matlack
Date: Wed Jan 14 2026 - 12:09:18 EST
On 2026-01-09 11:05 AM, Raghavendra Rao Ananta wrote:
> On Wed, Jan 7, 2026 at 3:22 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
> > On 2025-12-10 06:14 PM, Raghavendra Rao Ananta wrote:
> > > +static struct vfio_pci_device *test_vfio_pci_device_init(const char *bdf,
> > > + struct iommu *iommu,
> > > + const char *vf_token,
> > > + int *out_ret)
> > > +{
> > > + struct vfio_pci_device *device;
> > > +
> > > + device = calloc(1, sizeof(*device));
> > > + VFIO_ASSERT_NOT_NULL(device);
> > > +
> > > + device->iommu = iommu;
> > > + device->bdf = bdf;
> >
> > Can you put this in a helper exposed by vfio_pci_device.h? e.g.
> > vfio_pci_device_alloc()
> >
> Is that just to wrap the ASSERT() within? Or were you thinking of
> initializing the members as well in there?
I was thinking it would include all of the above.