@@ -274,7 +274,7 @@ extern int vfio_kvm_device_fd;
bool vfio_mig_active(void);
int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp);
void vfio_unblock_multiple_devices_migration(void);
-bool vfio_viommu_preset(VFIODevice *vbasedev);
+bool vfio_viommu_preset(VFIOContainerBase *bcontainer);
int64_t vfio_mig_bytes_transferred(void);
void vfio_reset_bytes_transferred(void);
bool vfio_device_state_is_running(VFIODevice *vbasedev);
@@ -142,9 +142,9 @@ void vfio_unblock_multiple_devices_migration(void)
migrate_del_blocker(&multiple_devices_migration_blocker);
}
-bool vfio_viommu_preset(VFIODevice *vbasedev)
+bool vfio_viommu_preset(VFIOContainerBase *bcontainer)
{
- return vbasedev->bcontainer->space->as != &address_space_memory;
+ return bcontainer->space->as != &address_space_memory;
}
static void vfio_set_migration_error(int ret)
@@ -1069,7 +1069,7 @@ bool vfio_migration_realize(VFIODevice *vbasedev, Error **errp)
goto out_deinit;
}
- if (vfio_viommu_preset(vbasedev)) {
+ if (vfio_viommu_preset(vbasedev->bcontainer)) {
error_setg(&err, "%s: Migration is currently not supported "
"with vIOMMU enabled", vbasedev->name);
goto add_blocker;
We plan to use vfio_viommu_preset() in MemoryListener handlers which operate at the container level. Change the parameter to VFIOContainerBase to ease future changes. Signed-off-by: Cédric Le Goater <clg@redhat.com> --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/common.c | 4 ++-- hw/vfio/migration.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)