summary refs log tree commit diff stats
path: root/hw/vfio/vfio-helpers.h
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2025-03-26 08:51:07 +0100
committerCédric Le Goater <clg@redhat.com>2025-04-25 09:01:37 +0200
commitc3fbdba15a8b3d80c1f5e6026e636030b3692437 (patch)
treeeb2a8ed39a263935b35eed21a8e433f8450e4e04 /hw/vfio/vfio-helpers.h
parent8140d45b108c2b48960bbfb0a215f586f2d1d9e5 (diff)
downloadfocaccia-qemu-c3fbdba15a8b3d80c1f5e6026e636030b3692437.tar.gz
focaccia-qemu-c3fbdba15a8b3d80c1f5e6026e636030b3692437.zip
vfio: Move vfio_kvm_device_fd() into helpers.c
The vfio_kvm_device_add/del_fd() routines opening the VFIO pseudo
device are defined in "helpers.c". Move 'vfio_kvm_device_fd'
definition there and its declaration into "vfio-helpers.h" to reduce
exposure of VFIO internals in "hw/vfio/vfio-common.h".

Reviewed-by: John Levon <john.levon@nutanix.com>
Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-22-clg@redhat.com
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-23-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/vfio-helpers.h')
-rw-r--r--hw/vfio/vfio-helpers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/vfio/vfio-helpers.h b/hw/vfio/vfio-helpers.h
index dbcb68bbb0..54a327ffbc 100644
--- a/hw/vfio/vfio-helpers.h
+++ b/hw/vfio/vfio-helpers.h
@@ -12,6 +12,8 @@
 #ifdef CONFIG_LINUX
 #include <linux/vfio.h>
 
+extern int vfio_kvm_device_fd;
+
 struct vfio_info_cap_header *
 vfio_get_cap(void *ptr, uint32_t cap_offset, uint16_t id);
 struct vfio_info_cap_header *