From d04a35cb742e6e3b3682e31addb7b68b22b1c6c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 26 Mar 2025 08:50:50 +0100 Subject: [PATCH] vfio: Make vfio_viommu_preset() static MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This routine is only used in file "migration.c". Move it there. Reviewed-by: John Levon Reviewed-by: Joao Martins Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-6-clg@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-6-clg@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 5 ----- hw/vfio/migration.c | 5 +++++ include/hw/vfio/vfio-common.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index d65e77b93a..679076343a 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -65,11 +65,6 @@ int vfio_kvm_device_fd = -1; */ -bool vfio_viommu_preset(VFIODevice *vbasedev) -{ - return vbasedev->bcontainer->space->as != &address_space_memory; -} - bool vfio_device_state_is_running(VFIODevice *vbasedev) { VFIOMigration *migration = vbasedev->migration; diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index ace3d8548e..b5bb0cd092 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -1138,6 +1138,11 @@ bool vfio_migration_active(void) return true; } +static bool vfio_viommu_preset(VFIODevice *vbasedev) +{ + return vbasedev->bcontainer->space->as != &address_space_memory; +} + /* * Return true when either migration initialized or blocker registered. * Currently only return false when adding blocker fails which will diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 5f1c0bee9d..8c56921506 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -290,7 +290,6 @@ extern VFIODeviceList vfio_device_list; extern const MemoryListener vfio_memory_listener; extern int vfio_kvm_device_fd; -bool vfio_viommu_preset(VFIODevice *vbasedev); void vfio_migration_add_bytes_transferred(unsigned long val); bool vfio_device_state_is_running(VFIODevice *vbasedev); bool vfio_device_state_is_precopy(VFIODevice *vbasedev); -- 2.39.5