vfio/platform: Make vfio cdev pre-openable by passing a file handle
commit3016e60f8f715d2058a48e4956be994482c5e218
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 21 Nov 2023 08:44:12 +0000 (21 16:44 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 18:03:38 +0000 (19 19:03 +0100)
treebef9c45045df72c31ca1aca929eb2c90cff51389
parenta6c50e1c3f8d0eb77edaea392e61508bb3c516f8
vfio/platform: 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.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/platform.c