qemu-e2k/include/hw/vfio
Zhenzhong Duan da3e04b26f vfio/pci: Make vfio cdev pre-openable by passing a file handle
This gives management tools like libvirt a chance to open the vfio
cdev with privilege and pass FD to qemu. This way qemu never needs
to have privilege to open a VFIO or iommu cdev node.

Together with the earlier support of pre-opening /dev/iommu device,
now we have full support of passing a vfio device to unprivileged
qemu by management tool. This mode is no more considered for the
legacy backend. So let's remove the "TODO" comment.

Add helper functions vfio_device_set_fd() and vfio_device_get_name()
to set fd and get device name, they will also be used by other vfio
devices.

There is no easy way to check if a device is mdev with FD passing,
so fail the x-balloon-allowed check unconditionally in this case.

There is also no easy way to get BDF as name with FD passing, so
we fake a name by VFIO_FD[fd].

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2023-12-19 19:03:38 +01:00
..
vfio-amd-xgbe.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
vfio-calxeda-xgmac.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
vfio-common.h vfio/pci: Make vfio cdev pre-openable by passing a file handle 2023-12-19 19:03:38 +01:00
vfio-container-base.h vfio/pci: Introduce a vfio pci hot reset interface 2023-12-19 19:03:38 +01:00
vfio-platform.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00