linux/tools/testing/selftests/vfio/lib/include/libvfio
Raghavendra Rao Ananta 3152e7f457 vfio: selftests: Add helpers to alloc/free vfio_pci_device
Add a helper, vfio_pci_device_alloc(), to allocate 'struct
vfio_pci_device'. The subsequent test patch will utilize this
to get the struct with very minimal initialization done.
Internally, let vfio_pci_device_init() also make use of this
function and later do the full initialization.

Symmetrically, add a free variant, vfio_pci_device_free(),
to be used in a similar fashion.

No functional change intended.

Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Vipin Sharma <vipinsh@google.com>
Tested-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20260505212838.1698034-8-rananta@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2026-05-20 11:54:10 -06:00
..
assert.h vfio: selftests: Introduce snprintf_assert() 2026-05-20 11:54:10 -06:00
iommu.h vfio: selftests: Centralize IOMMU mode name definitions 2026-01-19 10:06:29 -07:00
iova_allocator.h vfio: selftests: Drop <uapi/linux/types.h> includes 2025-12-23 14:17:13 -07:00
sysfs.h vfio: selftests: Introduce a sysfs lib 2026-05-20 11:54:10 -06:00
vfio_pci_device.h vfio: selftests: Add helpers to alloc/free vfio_pci_device 2026-05-20 11:54:10 -06:00
vfio_pci_driver.h vfio: selftests: Split libvfio.h into separate header files 2025-11-28 10:58:07 -07:00