From: Eric Blake <eblake@redhat.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, hreitz@redhat.com,
kwolf@redhat.com, qemu-stable@nongnu.org
Subject: Re: [PATCH qemu 4/4] qemu-img: convert: flush target image after copying
Date: Tue, 6 Oct 2026 09:29:03 -0500 [thread overview]
Message-ID: <asUDdHfFgP7RoMk5@redhat.com> (raw)
In-Reply-To: <20260930132140.2342574-5-f.ebner@proxmox.com>
On Wed, Sep 30, 2026 at 03:19:25PM +0200, Fiona Ebner wrote:
> With 'qemu-img convert', when using a cache mode with 'cache.no-flush
> = off', the expectation is that the data is flushed to the disk, which
> happens since commit 80ccf93b88 ("qemu-img: let 'qemu-img convert'
> flush data"). This expectation also encompasses that failure to do so
> is properly reported, so ensure that 'qemu-img convert' exits with a
> non-zero status code when the target image cannot be flushed.
>
> In particular, the reproducer below [0], based on a report by
> Ing. Alfonso Kuen Arroyo [1], would result in
> > rc=0
> > Content mismatch at offset XYZ!
> before this change, and in
> > rc=1
> > Content mismatch at offset XYZ!
> after this change.
>
> Note that this change does not affect the (default) 'unsafe' cache
> mode, because bdrv_co_flush() still skips flush to disk for that cache
> mode.
Should we rethink the default? I get that during a long-running
qemu-img convert, it makes sense to avoid intermediate calls to flush
(the destination image is not going to be in use by a guest until the
qemu-img process completes, so there is no need to slow down the
conversion). But should we have a mode of operation where we guarantee
that we flush before exiting qemu-img, while ginoring all other flush
points in the middle (in between an explicit request for all
intermediate flushes to be acted on, vs. an explicit request to not do
any flushing at all), as as safer default going forward? That way, you
have to explicitly opt in to a case where qemu-img convert might
produce a corrupted copy due to an undiagnosed flush failure.
But I think that question can be deferred to another day - this patch
has merit of adding diagnosis for the setup of anyone explicitly
requesting flush safety of some sort, even if it doesn't change
behavior for the defaults when the user did not make an explicit flush
request.
Reviewed-by: Eric Blake <eblake@redhat.com>
This series caught my eyes because of the scenario you mentioned of an
NBD connection dying before a flush can finalize; so I'm planning on
queuing it through my NBD tree shortly.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
prev parent reply other threads:[~2026-10-07 7:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 13:19 [PATCH qemu 0/4] block/qemu-img convert: better handle failing flush Fiona Ebner
2026-09-30 13:19 ` [PATCH qemu 1/4] iotests: add test cases for failing flush after qemu-img convert Fiona Ebner
2026-10-06 14:07 ` Eric Blake
2026-09-30 13:19 ` [PATCH qemu 2/4] iotests.py: add filter_qemu() Fiona Ebner
2026-10-06 14:08 ` Eric Blake
2026-09-30 13:19 ` [PATCH qemu 3/4] block: report flush error during bdrv_close() Fiona Ebner
2026-10-06 14:18 ` Eric Blake
2026-09-30 13:19 ` [PATCH qemu 4/4] qemu-img: convert: flush target image after copying Fiona Ebner
2026-10-06 14:29 ` Eric Blake [this message]
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=asUDdHfFgP7RoMk5@redhat.com \
--to=eblake@redhat.com \
--cc=f.ebner@proxmox.com \
--cc=hreitz@redhat.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.