vfio/common: Extract out vfio_kvm_device_[add/del]_fd
commit5621c02d5adf3841884bb751ec8cf43d931aaa25
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Mon, 9 Oct 2023 09:09:08 +0000 (9 11:09 +0200)
committerCédric Le Goater <clg@redhat.com>
Wed, 18 Oct 2023 08:10:49 +0000 (18 10:10 +0200)
tree26d63c37f464dc7535ec4e49a57cf364c8d4202f
parenta33832b1948561bb2606371de0c5e2ef03921d93
vfio/common: Extract out vfio_kvm_device_[add/del]_fd

Introduce two new helpers, vfio_kvm_device_[add/del]_fd
which take as input a file descriptor which can be either a group fd or
a cdev fd. This uses the new KVM_DEV_VFIO_FILE VFIO KVM device group,
which aliases to the legacy KVM_DEV_VFIO_GROUP.

vfio_kvm_device_[add/del]_group then call those new helpers.

Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/common.c
include/hw/vfio/vfio-common.h