aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2025-03-26 08:50:46 +0100
committerCédric Le Goater <clg@redhat.com>2025-04-25 09:01:37 +0200
commitacea0f0fafcf89f374fd7a69a4cd2c91d6d7d68a (patch)
tree24e2194df6032d9c737e72f455c3c8b6caa92092
parentd5e8e6195bcd37292657b5f69d7633b51670caf1 (diff)
downloadqemu-acea0f0fafcf89f374fd7a69a4cd2c91d6d7d68a.zip
qemu-acea0f0fafcf89f374fd7a69a4cd2c91d6d7d68a.tar.gz
qemu-acea0f0fafcf89f374fd7a69a4cd2c91d6d7d68a.tar.bz2
vfio: Move vfio_mig_active() into migration.c
vfio_mig_active() is part of the VFIO migration API. Move the definitions where VFIO migration is implemented. Reviewed-by: Avihai Horon <avihaih@nvidia.com> Reviewed-by: John Levon <john.levon@nutanix.com> Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-2-clg@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-2-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--hw/vfio/common.c16
-rw-r--r--hw/vfio/migration.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 5ef1493..2ea4e12 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -65,22 +65,6 @@ int vfio_kvm_device_fd = -1;
* Device state interfaces
*/
-bool vfio_mig_active(void)
-{
- VFIODevice *vbasedev;
-
- if (QLIST_EMPTY(&vfio_device_list)) {
- return false;
- }
-
- QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) {
- if (vbasedev->migration_blocker) {
- return false;
- }
- }
- return true;
-}
-
static Error *multiple_devices_migration_blocker;
/*
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index fbff46c..b5fb0d2 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -1062,6 +1062,22 @@ void vfio_mig_add_bytes_transferred(unsigned long val)
qatomic_add(&bytes_transferred, val);
}
+bool vfio_mig_active(void)
+{
+ VFIODevice *vbasedev;
+
+ if (QLIST_EMPTY(&vfio_device_list)) {
+ return false;
+ }
+
+ QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) {
+ if (vbasedev->migration_blocker) {
+ return false;
+ }
+ }
+ return true;
+}
+
/*
* Return true when either migration initialized or blocker registered.
* Currently only return false when adding blocker fails which will