From: Fabiano Rosas <farosas@suse.de>
To: Ben Chaney <bchaney@akamai.com>, qemu-devel@nongnu.org
Cc: "Peter Xu" <peterx@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Alex Williamson" <alex@shazbot.org>,
"Cédric Le Goater" <clg@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Hamza Khan" <hamza.khan@nutanix.com>,
"Mark Kanda" <mark.kanda@oracle.com>,
"Joshua Hunt" <johunt@akamai.com>,
"Max Tottenham" <mtottenh@akamai.com>,
"Ben Chaney" <bchaney@akamai.com>,
"Steve Sistare" <steven.sistare@oracle.com>
Subject: Re: [PATCH v4 2/8] migration: cpr setup notifier
Date: Mon, 02 Feb 2026 11:01:55 -0300 [thread overview]
Message-ID: <87tsvzs0q4.fsf@suse.de> (raw)
In-Reply-To: <20260128-cpr-tap-v4-2-48e334d4216b@akamai.com>
Ben Chaney <bchaney@akamai.com> writes:
> From: Steve Sistare <steven.sistare@oracle.com>
>
> Call MIG_EVENT_PRECOPY_SETUP earlier, before CPR starts. An early notifier
> is needed for resetting vhost devices, as explained in the next patch.
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> Signed-off-by: Ben Chaney <bchaney@akamai.com>
> ---
> migration/migration.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index f36e59d9e8..191a34f667 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -2306,7 +2306,14 @@ void qmp_migrate(const char *uri, bool has_channels,
> stopped = true;
> }
>
> + /* Notify before starting migration thread, and before starting cpr */
> + if (!resume_requested &&
> + migration_call_notifiers(s, MIG_EVENT_PRECOPY_SETUP, &local_err)) {
> + goto out;
> + }
Probably better at the end of migrate_init() or along with the state
change to SETUP.
Also note that this will emit the event even before connections have
been established. I didn't spot any issues with that.
> +
> if (!cpr_state_save(cpr_channel, &local_err)) {
> + migration_call_notifiers(s, MIG_EVENT_PRECOPY_FAILED, NULL);
Due to changes on master, this now needs to go into
migration_connect_error_propagate() so that all paths that saw
MIG_EVENT_PRECOPY_SETUP also see MIG_EVENT_PRECOPY_FAILED.
migrate_prepare() -> MIG_EVENT_PRECOPY_SETUP
migration_connect_error_propagate() -> MIG_EVENT_PRECOPY_FAILED
migration_iteration_finish() -> MIG_EVENT_PRECOPY_FAILED
migration_cleanup() -> MIG_EVENT_PRECOPY_DONE
And due to changes queued [0], migration_cleanup() no longer emits the
FAILED event, so migration_connect_error_propagate() needs to send the
event for both FAILED and CANCELLING states, you can use the
migration_has_failed() helper.
https://lore.kernel.org/r/20260126213614.3815900-1-peterx@redhat.com
The special case at migrate_cancel() will also need
MIG_EVENT_PRECOPY_FAILED before resuming the VM.
> goto out;
> }
>
> @@ -4097,11 +4104,6 @@ void migration_connect(MigrationState *s, Error *error_in)
> } else {
> /* This is a fresh new migration */
> rate_limit = migrate_max_bandwidth();
> -
> - /* Notify before starting migration thread */
> - if (migration_call_notifiers(s, MIG_EVENT_PRECOPY_SETUP, &local_err)) {
> - goto fail;
> - }
> }
>
> migration_rate_set(rate_limit);
next prev parent reply other threads:[~2026-02-02 14:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 20:39 [PATCH v4 0/8] Live update: tap and vhost Ben Chaney
2026-01-28 20:39 ` [PATCH v4 1/8] migration: stop vm earlier for cpr Ben Chaney
2026-02-02 13:31 ` Fabiano Rosas
2026-01-28 20:39 ` [PATCH v4 2/8] migration: cpr setup notifier Ben Chaney
2026-02-02 14:01 ` Fabiano Rosas [this message]
2026-01-28 20:39 ` [PATCH v4 3/8] vhost: reset vhost devices for cpr Ben Chaney
2026-01-28 20:39 ` [PATCH v4 4/8] cpr: delete all fds Ben Chaney
2026-01-28 20:39 ` [PATCH v4 5/8] tap: common return label Ben Chaney
2026-01-28 20:39 ` [PATCH v4 6/8] tap: cpr support Ben Chaney
2026-02-04 13:05 ` Markus Armbruster
2026-01-28 20:39 ` [PATCH v4 7/8] tap: postload fix for cpr Ben Chaney
2026-01-28 20:39 ` [PATCH v4 8/8] tap: cpr fixes Ben Chaney
2026-01-29 13:58 ` [PATCH v4 0/8] Live update: tap and vhost Vladimir Sementsov-Ogievskiy
2026-02-02 14:06 ` Peter Xu
2026-02-02 15:42 ` Chaney, Ben
2026-02-03 9:57 ` Vladimir Sementsov-Ogievskiy
2026-02-03 19:17 ` Peter Xu
2026-02-03 19:46 ` Chaney, Ben
2026-02-03 20:04 ` Mark Kanda
2026-02-03 20:47 ` Peter Xu
2026-02-04 7:56 ` Vladimir Sementsov-Ogievskiy
2026-02-04 16:34 ` 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=87tsvzs0q4.fsf@suse.de \
--to=farosas@suse.de \
--cc=alex@shazbot.org \
--cc=armbru@redhat.com \
--cc=bchaney@akamai.com \
--cc=berrange@redhat.com \
--cc=clg@redhat.com \
--cc=eblake@redhat.com \
--cc=hamza.khan@nutanix.com \
--cc=jasowang@redhat.com \
--cc=johunt@akamai.com \
--cc=mark.kanda@oracle.com \
--cc=mst@redhat.com \
--cc=mtottenh@akamai.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=steven.sistare@oracle.com \
--cc=sw@weilnetz.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.