[PATCH for-10.1 v2 05/37] vfio: Make vfio_viommu_preset() static

Cédric Le Goater posted 37 patches 1 week ago
[PATCH for-10.1 v2 05/37] vfio: Make vfio_viommu_preset() static
Posted by Cédric Le Goater 1 week ago
This routine is only used in file "migration.c". Move it there.

Reviewed-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-6-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 include/hw/vfio/vfio-common.h | 1 -
 hw/vfio/common.c              | 5 -----
 hw/vfio/migration.c           | 5 +++++
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 32b816fa122aee00840c70d2e208310a845ad831..8bb206d755adab4efee32a173c920d9aa4833685 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);
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index f78fff41639b83b82eeadf4e40b7ca2cf6bd64dd..a4ec60e018df7dc9bbbeac27120907b0f7bf2f83 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -66,11 +66,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 db2525fcb926bd228ae2d4dca5eeb2de28041660..96d294794bc3056baa3b0b4e23488402db5de797 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -1141,6 +1141,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
-- 
2.49.0