From: no-reply@sashiko.virtuozzo.com
To: "Denis V. Lunev" <den@openvz.org>, svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com
Subject: Re: [PATCH hci-8.1 1/2] migration: fix source hang on cancel before the channel connects #VSTOR-155277
Date: Tue, 1 Dec 2026 00:30:29 +0000 [thread overview]
Message-ID: <010701a22f029bec-701aecce-b69c-4043-9487-5de399bd72df-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261125193204.1424799-2-den@openvz.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] migration: cancel during postcopy resume connect hangs in
migration_cleanup()
--
commit c746b1b1a4198168dbe30b6b4ea7b0bb9e2bd656
Author: Denis V. Lunev <den@openvz.org>
migration: fix source hang on cancel before the channel connects #VSTOR-155277
When a cancel arrives while the source is still connecting, this patch makes migration_channel_connect() call migration_cleanup() once the connection is up. That happens before the return path and migration threads are started. migration_cleanup() is made non-static so channel.c can call it.
> diff --git a/migration/channel.c b/migration/channel.c
> index a547b1fbfebee..6016d6e47d86b 100644
> --- a/migration/channel.c
> +++ b/migration/channel.c
> @@ -73,6 +73,12 @@ void migration_channel_connect(MigrationState *s,
> ioc, object_get_typename(OBJECT(ioc)), hostname, error);
>
> if (!error) {
> + /* migration_cancel() leaves a cancel during connect for us to finish */
> + if (s->state == MIGRATION_STATUS_CANCELLING) {
> + migration_cleanup(s);
> + return;
> + }
> +
[Severity: Low]
Can this hang for a postcopy resume connect? If migration_cancel() moves
POSTCOPY_RECOVER_SETUP to CANCELLING, the old migration thread is still
parked in postcopy_pause() on qemu_sem_wait(&s->postcopy_pause_sem), and
migration_cancel() does not post that semaphore.
When the connect completes, this check calls migration_cleanup().
Because migration_thread_running is true, it does qemu_thread_join(&s->thread)
and blocks forever with the BQL held, so the monitor stops answering.
qmp_migrate_cancel() refuses to cancel in this state because
migration_in_postcopy() covers POSTCOPY_RECOVER_SETUP. But
ram_mig_ram_block_resized() calls migration_cancel() whenever
migration_is_running() is true, with no postcopy guard. A RAM block resize
on the paused source during the resume could reach it.
The commit message only discusses fresh migrations. Before this patch,
migration_connect() would instead start a second migration thread in this
case, so the outcome was also broken, but now it is a hang.
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261125193204.1424799-1-den@openvz.org?part=1
next prev parent reply other threads:[~2026-12-01 0:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 19:32 [PATCH hci-8.1/hci-dev 0/2] migration: fix a " Denis V. Lunev
2026-11-25 19:32 ` [PATCH hci-8.1 1/2] migration: fix " Denis V. Lunev
2026-12-01 0:30 ` no-reply [this message]
2026-11-25 19:32 ` [PATCH hci-8.1 2/2] tests/qtest/migration: test " Denis V. Lunev
2026-12-01 0:31 ` no-reply
2026-11-25 20:14 ` [PATCH hci-8.1/hci-dev 0/2] migration: fix a source hang on " Andrey Drobyshev
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=010701a22f029bec-701aecce-b69c-4043-9487-5de399bd72df-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@openvz.org \
--cc=svt-core@virtuozzo.com \
/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.