On Tue, Dec 03, 2024 at 07:51:33PM -0500, Peter Xu wrote:
> diff --git a/migration/migration.c b/migration/migration.c
> index 8f7d09ca84..e01264168f 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -701,6 +701,12 @@ migration_incoming_state_setup(MigrationIncomingState
> *mis, Error **errp)
> return false;
> }
>
> + /*
> + * Newly setup QEMU, prepared for incoming migration. Mark the block
> + * active state to reflect that the src currently owns the disks.
> + */
> + migrate_get_current()->block_active = false;
> +
> migrate_set_state(&mis->state, current, MIGRATION_STATUS_SETUP);
> return true;
> }
I plan to move this over to the end of qmp_migrate_incoming(), which might
be easier to follow (where we updated "once"..), to say that we initialize
the value to FALSE once and for all for an incoming instance.
I don't think there's any functional change on the fixup. The only
difference is when qemu_start_incoming_migration() can fail after
migration_incoming_state_setup(). I don't think it matter hugely on the
block_active flag itself.. as if that failure happens it means the next
qmp_migrate_incoming will overwrite the flag again with nobody being able
to touch it.. But still, if I'll post a new version I'll squash below into
this patch:
===8<===
diff --git a/migration/migration.c b/migration/migration.c
index 1a1c570c5b..bc3a29482a 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -701,12 +701,6 @@ migration_incoming_state_setup(MigrationIncomingState
*mis, Error **errp)
return false;
}
- /*
- * Newly setup QEMU, prepared for incoming migration. Mark the block
- * active state to reflect that the src currently owns the disks.
- */
- migrate_get_current()->block_active = false;
-
migrate_set_state(&mis->state, current, MIGRATION_STATUS_SETUP);
return true;
}
@@ -1892,6 +1886,12 @@ void qmp_migrate_incoming(const char *uri, bool
has_channels,
return;
}
+ /*
+ * Newly setup incoming QEMU. Mark the block active state to reflect
+ * that the src currently owns the disks.
+ */
+ migrate_get_current()->block_active = false;
+
once = false;
}
--
Peter Xu