|
@@ -184,12 +184,18 @@ static bool vfio_devices_all_device_dirty_tracking_started(
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+bool vfio_devices_all_dirty_tracking_started(
|
|
|
+ const VFIOContainerBase *bcontainer)
|
|
|
+{
|
|
|
+ return vfio_devices_all_device_dirty_tracking_started(bcontainer) ||
|
|
|
+ bcontainer->dirty_pages_started;
|
|
|
+}
|
|
|
+
|
|
|
static bool vfio_devices_all_dirty_tracking(VFIOContainerBase *bcontainer)
|
|
|
{
|
|
|
VFIODevice *vbasedev;
|
|
|
|
|
|
- if (!(vfio_devices_all_device_dirty_tracking_started(bcontainer) ||
|
|
|
- bcontainer->dirty_pages_started)) {
|
|
|
+ if (!vfio_devices_all_dirty_tracking_started(bcontainer)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -225,36 +231,6 @@ bool vfio_devices_all_device_dirty_tracking(const VFIOContainerBase *bcontainer)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Check if all VFIO devices are running and migration is active, which is
|
|
|
- * essentially equivalent to the migration being in pre-copy phase.
|
|
|
- */
|
|
|
-bool
|
|
|
-vfio_devices_all_running_and_mig_active(const VFIOContainerBase *bcontainer)
|
|
|
-{
|
|
|
- VFIODevice *vbasedev;
|
|
|
-
|
|
|
- if (!migration_is_active()) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- QLIST_FOREACH(vbasedev, &bcontainer->device_list, container_next) {
|
|
|
- VFIOMigration *migration = vbasedev->migration;
|
|
|
-
|
|
|
- if (!migration) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (vfio_device_state_is_running(vbasedev) ||
|
|
|
- vfio_device_state_is_precopy(vbasedev)) {
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
-}
|
|
|
-
|
|
|
static bool vfio_listener_skipped_section(MemoryRegionSection *section)
|
|
|
{
|
|
|
return (!memory_region_is_ram(section->mr) &&
|