From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
qemu-stable@nongnu.org
Subject: Re: [PATCH v2 2/3] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes
Date: Wed, 7 Oct 2026 07:01:14 -0500 [thread overview]
Message-ID: <asYzgmzKbr0ZxlXt@redhat.com> (raw)
In-Reply-To: <20261006170738.453977-3-den@openvz.org>
On Tue, Oct 06, 2026 at 07:07:37PM +0200, Denis V. Lunev wrote:
> From: Denis V. Lunev <den@openvz.org>
>
> With dirty bitmaps on more than one node, the source switches nodes
> during the postcopy bulk phase and sends the node name again. The
> destination reads those chunks in the postcopy listen thread, which does
> not hold the BQL, and resolves the name through bdrv_lookup_bs():
>
> qemu-system-x86_64: ../block.c:6400: bdrv_lookup_bs: Assertion
> `qemu_in_main_thread()' failed.
>
> The bdrv_find_dirty_bitmap() call right after it needs the BQL or the
> dirty bitmap lock as well. Taking the BQL there would deadlock: the
> listen thread holds s->lock, and dirty_bitmap_mig_before_vm_start()
> takes s->lock with the BQL held.
>
> Every node and bitmap that a non-START chunk refers to was set up by a
> START chunk, and those are loaded under the BQL during setup. Record the
> node alias there, and resolve all other chunks against s->bitmaps
> instead of the block graph.
>
> Bitmaps on a single node never resend the node name after setup, which
> is why migrate-bitmaps-postcopy-test does not catch this.
>
> Fixes: f791bf7f93f2 ("assertions for block global state API")
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> Cc: qemu-stable@nongnu.org
> ---
> migration/block-dirty-bitmap.c | 58 +++++++++++++++++++++++++++++++---
> 1 file changed, 54 insertions(+), 4 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
next prev parent reply other threads:[~2026-10-07 12:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 17:07 [PATCH v2 0/3] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes Denis V. Lunev
2026-10-06 17:07 ` [PATCH v2 1/3] migration: add QEMU_COUNTED_STRING_SIZE for counted string buffers Denis V. Lunev
2026-10-06 21:33 ` Eric Blake
2026-10-06 17:07 ` [PATCH v2 2/3] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes Denis V. Lunev
2026-10-07 12:01 ` Eric Blake [this message]
2026-10-06 17:07 ` [PATCH v2 3/3] iotests/migrate-bitmaps-postcopy-test: add a bitmap on a second node Denis V. Lunev
2026-10-07 21:44 ` Eric Blake
2026-10-07 12:22 ` [PATCH v2 0/3] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes Eric Blake
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=asYzgmzKbr0ZxlXt@redhat.com \
--to=eblake@redhat.com \
--cc=den@openvz.org \
--cc=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--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 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.