[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 06/11] migration/block: Extend the migration_block_* API
From: |
Peter Xu |
Subject: |
Re: [PATCH RFC 06/11] migration/block: Extend the migration_block_* API to dest side |
Date: |
Wed, 4 Dec 2024 09:49:55 -0500 |
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
- [PATCH RFC 00/11] migration/block: disk activation rewrite, Peter Xu, 2024/12/03
- [PATCH RFC 01/11] migration: Add helper to get target runstate, Peter Xu, 2024/12/03
- [PATCH RFC 03/11] migration/block: Apply late-block-active behavior to postcopy, Peter Xu, 2024/12/03
- [PATCH RFC 02/11] migration/block: Make late-block-active the default, Peter Xu, 2024/12/03
- [PATCH RFC 06/11] migration/block: Extend the migration_block_* API to dest side, Peter Xu, 2024/12/03
- Re: [PATCH RFC 06/11] migration/block: Extend the migration_block_* API to dest side,
Peter Xu <=
- [PATCH RFC 05/11] migration/block: Merge block reactivations for fail/cancel, Peter Xu, 2024/12/03
- [PATCH RFC 04/11] migration/block: Fix possible race with block_inactive, Peter Xu, 2024/12/03
- [PATCH RFC 08/11] tests/qtest/migration: Move more code under only_target, Peter Xu, 2024/12/03
- [PATCH RFC 10/11] tests/qtest/migration: Support cleaning up only one side of migration, Peter Xu, 2024/12/03
- [PATCH RFC 09/11] tests/qtest/migration: Don't use hardcoded strings for -serial, Peter Xu, 2024/12/03
- [PATCH RFC 07/11] migration/block: Apply the migration_block_* API to postcopy, Peter Xu, 2024/12/03
- [PATCH RFC 11/11] tests/qtest/migration: Test successive migrations, Peter Xu, 2024/12/03
- Re: [PATCH RFC 00/11] migration/block: disk activation rewrite, Peter Xu, 2024/12/04