From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Fabiano Rosas" <farosas@suse.de>,
"Dr . David Alan Gilbert" <dave@treblig.org>,
"Eric Blake" <eblake@redhat.com>, "Kevin Wolf" <kwolf@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Andrey Drobyshev" <andrey.drobyshev@virtuozzo.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>
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 [thread overview]
Message-ID: <Z1BsE6AggPtkSGvC@x1n> (raw)
In-Reply-To: <20241204005138.702289-7-peterx@redhat.com>
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
next prev parent reply other threads:[~2024-12-04 14:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 0:51 [PATCH RFC 00/11] migration/block: disk activation rewrite Peter Xu
2024-12-04 0:51 ` [PATCH RFC 01/11] migration: Add helper to get target runstate Peter Xu
2024-12-04 0:51 ` [PATCH RFC 02/11] migration/block: Make late-block-active the default Peter Xu
2024-12-04 0:51 ` [PATCH RFC 03/11] migration/block: Apply late-block-active behavior to postcopy Peter Xu
2024-12-04 0:51 ` [PATCH RFC 04/11] migration/block: Fix possible race with block_inactive Peter Xu
2024-12-04 0:51 ` [PATCH RFC 05/11] migration/block: Merge block reactivations for fail/cancel Peter Xu
2024-12-04 0:51 ` [PATCH RFC 06/11] migration/block: Extend the migration_block_* API to dest side Peter Xu
2024-12-04 14:49 ` Peter Xu [this message]
2024-12-04 0:51 ` [PATCH RFC 07/11] migration/block: Apply the migration_block_* API to postcopy Peter Xu
2024-12-04 0:51 ` [PATCH RFC 08/11] tests/qtest/migration: Move more code under only_target Peter Xu
2024-12-04 0:51 ` [PATCH RFC 09/11] tests/qtest/migration: Don't use hardcoded strings for -serial Peter Xu
2024-12-04 19:11 ` Fabiano Rosas
2024-12-04 0:51 ` [PATCH RFC 10/11] tests/qtest/migration: Support cleaning up only one side of migration Peter Xu
2024-12-04 0:51 ` [PATCH RFC 11/11] tests/qtest/migration: Test successive migrations Peter Xu
2024-12-04 17:25 ` [PATCH RFC 00/11] migration/block: disk activation rewrite Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1BsE6AggPtkSGvC@x1n \
--to=peterx@redhat.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=berrange@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).