From acea0f0fafcf89f374fd7a69a4cd2c91d6d7d68a Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 26 Mar 2025 08:50:46 +0100 Subject: [PATCH] vfio: Move vfio_mig_active() into migration.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit vfio_mig_active() is part of the VFIO migration API. Move the definitions where VFIO migration is implemented. Reviewed-by: Avihai Horon Reviewed-by: John Levon 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 --- hw/vfio/common.c | 16 ---------------- hw/vfio/migration.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 5ef14931cd..2ea4e12c90 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 fbff46cfc3..b5fb0d2188 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 -- 2.39.5