All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Fastermann <e.fastermann@proxmox.com>
To: "Denis V. Lunev" <den@virtuozzo.com>
Cc: "Denis V. Lunev" <den@openvz.org>,
	Fiona Ebner <f.ebner@proxmox.com>, Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	qemu-stable@nongnu.org
Subject: Re: [PATCH] block: fix bdrv_next() skipping monitor-owned nodes
Date: Fri,  2 Oct 2026 12:07:03 +0200	[thread overview]
Message-ID: <20261002100703.244967-1-e.fastermann@proxmox.com> (raw)
In-Reply-To: <95e5ffd8-d193-41ff-9d65-433ed2ce6949@virtuozzo.com>

On 9/1/26 14:50, Denis V. Lunev wrote:
> On 9/1/26 14:23, Fiona Ebner wrote:
>> Should also go into stable I suppose?
>
> Unsure. We do not know real consequences, there are no reports.
> I found this problem by accident only testing migration with
> big trees a lot.

I came across the bug by accident while exploring the code.

It is easy to trigger with a plain -drive next to a detached -blockdev
node. If the last BlockBackend root is not monitor-owned, it is not on
monitor_bdrv_states, so bdrv_next_monitor_owned() returns NULL right
away and the second phase returns no node at all, not only those added
before it.

Reproducer:

  qemu-img create -f qcow2 a.qcow2 64M
  qemu-img create -f qcow2 b.qcow2 64M
  qemu-system-x86_64 -S -nodefaults -display none -monitor stdio \
    -drive file=a.qcow2,if=none,id=drv0 \
    -blockdev file,filename=b.qcow2,node-name=bfile \
    -blockdev qcow2,file=bfile,node-name=b0
  (qemu) savevm s1
  (qemu) info snapshots
  (qemu) quit
  qemu-img snapshot -l a.qcow2
  qemu-img snapshot -l b.qcow2

Without the fix, only a.qcow2 has snapshot s1 and savevm does not
report an error. Since "info snapshots" uses the same iterator, it
even lists s1 as present on all disks. With the fix, both images have
it.

For savevm, only nodes without any parent are affected, since
snapshots only consider nodes that are attached to a BlockBackend or
have no parent at all. Such detached nodes are rare and often
short-lived in practice I think, which would explain the lack of
reports. Still, the failure is silent, it is a regression since 9.0,
and the fix is a single line, so I think it is a good candidate for
stable.

Best regards,
Erik



  reply	other threads:[~2026-10-02 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 22:20 [PATCH] block: fix bdrv_next() skipping monitor-owned nodes Denis V. Lunev
2026-09-01 12:23 ` Fiona Ebner
2026-09-01 12:50   ` Denis V. Lunev
2026-10-02 10:07     ` Erik Fastermann [this message]
2026-09-07 10:45 ` Denis V. Lunev
2026-09-15 11:43 ` Denis V. Lunev
2026-09-21 19:40 ` Denis V. Lunev
2026-09-22 15:23 ` Kevin Wolf

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=20261002100703.244967-1-e.fastermann@proxmox.com \
    --to=e.fastermann@proxmox.com \
    --cc=den@openvz.org \
    --cc=den@virtuozzo.com \
    --cc=f.ebner@proxmox.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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.