diff options
author | Zhenzhong Duan <zhenzhong.duan@intel.com> | 2023-10-09 11:09:08 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2023-10-18 10:10:49 +0200 |
commit | 5621c02d5adf3841884bb751ec8cf43d931aaa25 (patch) | |
tree | 26d63c37f464dc7535ec4e49a57cf364c8d4202f /include/hw/vfio/vfio-common.h | |
parent | a33832b1948561bb2606371de0c5e2ef03921d93 (diff) |
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>
Diffstat (limited to 'include/hw/vfio/vfio-common.h')
-rw-r--r-- | include/hw/vfio/vfio-common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index e0483893d1..c4e7c3b4a7 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -226,6 +226,9 @@ struct vfio_device_info *vfio_get_device_info(int fd); int vfio_get_device(VFIOGroup *group, const char *name, VFIODevice *vbasedev, Error **errp); +int vfio_kvm_device_add_fd(int fd, Error **errp); +int vfio_kvm_device_del_fd(int fd, Error **errp); + extern const MemoryRegionOps vfio_region_ops; typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList; extern VFIOGroupList vfio_group_list; |