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 3/4] block: report flush error during bdrv_close()
Date: Tue, 6 Oct 2026 09:18:46 -0500 [thread overview]
Message-ID: <asUBLx7peVoGvX6w@redhat.com> (raw)
In-Reply-To: <20260930132140.2342574-4-f.ebner@proxmox.com>
On Wed, Sep 30, 2026 at 03:19:24PM +0200, Fiona Ebner wrote:
> Flush during bdrv_close() was introduced back in 2012 in commit
> 80ccf93b88 ("qemu-img: let 'qemu-img convert' flush data"). However, a
> failing flush was quietly ignored [0]. Report the error instead, since
> this could mean that the image contents are not as expected.
>
> Adapt the iotests accordingly. For all tests except '080' and
> 'qsd-migrate' the failures come from blkdebug configurations. For
> '080', the failures are also directly expected, because of invalid L1
> table size and offset. For the 'qsd-migrate' test, the error happens,
> because the QSD node which is attached via NBD to the source VM was
> inactivated.
>
> [0]: Note that the errors reported for qcow2 come from
> qcow2_inactivate() which is only called as part of
> bs->drv->bdrv_close() after bdrv_flush(). In particular, adding
> > 'once': 'on'
> to the blkdebug driver in the relevant test case in the 122 iotest
> shows that the failure can be silent in case of qcow2 too.
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> +++ b/tests/qemu-iotests/026
> @@ -103,13 +103,13 @@ if [ "$event" == "l2_update" ]; then
> $QEMU_IO -c "write $vmstate 0 512" "$TEST_IMG" > /dev/null 2>&1
> fi
>
> -$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
> +$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
This creates lines longer than 80 columns. Adding \-newline
continuations is an option. But there are plenty of existing long
lines in the iotests, so I don't see that as holding up this patch.
> +++ b/tests/qemu-iotests/122
> @@ -357,15 +357,15 @@ target_fails_flush="json:{
> }
> }"
>
> -$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "$target_fails_flush"
> -echo "qemu-img convert exited with status $?"
> +$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "$target_fails_flush" 2>&1 | _filter_json_filename
> +echo "qemu-img convert exited with status ${PIPESTATUS[0]}"
Interesting churn from $? to ${PIPESTATUS[0]} on a line added earlier
in the same series. But using PIPESTATUS when there is no |, while
valid in bash, looks odd, so I don't mind.
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 9:17 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 [this message]
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
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=asUBLx7peVoGvX6w@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.