From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-block@nongnu.org, stefanha@redhat.com,
qemu-devel@nongnu.org, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [PULL 2/3] rbd: Fix .bdrv_get_specific_info implementation
Date: Wed, 13 Aug 2025 11:00:35 +0200 [thread overview]
Message-ID: <aJxUM-ciwAUzgHYQ@redhat.com> (raw)
In-Reply-To: <30ecd389-fc8f-49e7-affa-99787f11d322@tls.msk.ru>
Am 13.08.2025 um 08:12 hat Michael Tokarev geschrieben:
> On 12.08.2025 22:59, Kevin Wolf wrote:
> > qemu_rbd_get_specific_info() has at least two problems:
> >
> > The first is that it issues a blocking rbd_read() call in order to probe
> > the encryption format for the image while querying the node. This means
> > that if the connection to the server goes down, not only I/O is stuck
> > (which is unavoidable), but query-names-block-nodes will actually make
> > the whole QEMU instance unresponsive. .bdrv_get_specific_info
> > implementations shouldn't perform blocking operations, but only return
> > what is already known.
> >
> > The second is that the information returned isn't even correct. If the
> > image is already opened with encryption enabled at the RBD level, we'll
> > probe for "double encryption", i.e. if the encrypted data contains
> > another encryption header. If it doesn't (which is the normal case), we
> > won't return the encryption format. If it does, we return misleading
> > information because it looks like we're talking about the outer level
> > (the encryption format of the image itself) while the information is
> > about an encryption header in the guest data.
> >
> > Fix this by storing the encryption format in BDRVRBDState when the image
> > is opened (and we do blocking operations anyway) and returning only the
> > stored information in qemu_rbd_get_specific_info().
> >
> > The information we'll store is either the actual encryption format that
> > we enabled on the RBD level, or if the image is unencrypted, the result
> > of the same probing as we previously did when querying the node. Probing
> > image formats based on content that can be modified by the guest has
> > long been known as problematic, but as long as we only output it to the
> > user instead of making decisions based on it, it should be okay. It is
> > undoubtedly useful in the context of 'qemu-img info' when you're trying
> > to figure out which encryption options you have to use to open the
> > image successfully.
> >
> > Fixes: 42e4ac9ef5a6 ("block/rbd: Add support for rbd image encryption")
> > Buglink: https://issues.redhat.com/browse/RHEL-105440
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > Message-ID: <20250811134010.81787-1-kwolf@redhat.com>
> > Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>
> This looks like a qemu-stable material (10.0). Please let me know
> if it is not.
I was on the verge of adding Cc: qemu-stable for it, but then decided
against it because it does subtly change behaviour in the common case
where the connection doesn't go down. On second thoughts, the common use
case is 'qemu-img info' where the image isn't opened encrypted (because
we're only trying to find out which encryption format it has), and that
output stays the same. So taking it into stable might still be
reasonable enough.
Kevin
next prev parent reply other threads:[~2025-08-13 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 19:58 [PULL 0/3] Patches for QEMU 10.1.0-rc3 Kevin Wolf
2025-08-12 19:58 ` [PULL 1/3] configure: Don't disable Rust for too old meson version Kevin Wolf
2025-08-12 19:59 ` [PULL 2/3] rbd: Fix .bdrv_get_specific_info implementation Kevin Wolf
2025-08-13 6:12 ` Michael Tokarev
2025-08-13 9:00 ` Kevin Wolf [this message]
2025-08-12 19:59 ` [PULL 3/3] qemu-iotests: Ignore indentation in Killed messages Kevin Wolf
2025-08-13 11:48 ` Michael Tokarev
2025-08-12 23:36 ` [PULL 0/3] Patches for QEMU 10.1.0-rc3 Stefan Hajnoczi
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=aJxUM-ciwAUzgHYQ@redhat.com \
--to=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.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.