qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 1/9] block: Improve error message when external snapshot can't flush
Date: Mon, 27 May 2024 13:31:23 +0200	[thread overview]
Message-ID: <20240527113131.2054486-2-armbru@redhat.com> (raw)
In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com>

external_snapshot_action() reports bdrv_flush() failure to its caller
as

    An IO error has occurred

The errno code returned by bdrv_flush() is lost.

Improve this to

    Write to node '<device or node name>' failed: <description of errno>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240513141703.549874-2-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 blockdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 08eccc9052..528db3452f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1406,8 +1406,10 @@ static void external_snapshot_action(TransactionAction *action,
     }
 
     if (!bdrv_is_read_only(state->old_bs)) {
-        if (bdrv_flush(state->old_bs)) {
-            error_setg(errp, QERR_IO_ERROR);
+        ret = bdrv_flush(state->old_bs);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "Write to node '%s' failed",
+                             bdrv_get_device_or_node_name(state->old_bs));
             return;
         }
     }
-- 
2.45.0



  reply	other threads:[~2024-05-27 11:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 11:31 [PULL 0/9] Error reporting patches for 2024-05-27 Markus Armbruster
2024-05-27 11:31 ` Markus Armbruster [this message]
2024-05-27 11:31 ` [PULL 2/9] dump/win_dump: Improve error messages on write error Markus Armbruster
2024-05-27 11:31 ` [PULL 3/9] block/vmdk: Improve error messages on extent " Markus Armbruster
2024-05-27 11:31 ` [PULL 4/9] cpus: Improve error messages on memsave, pmemsave " Markus Armbruster
2024-05-27 11:31 ` [PULL 5/9] migration: Rephrase message on failure to save / load Xen device state Markus Armbruster
2024-05-27 11:31 ` [PULL 6/9] qerror: QERR_IO_ERROR is no longer used, drop Markus Armbruster
2024-05-27 11:31 ` [PULL 7/9] qga-win32: Improve guest-set-user-password, guest-file-open errors Markus Armbruster
2024-05-27 11:31 ` [PULL 8/9] qga: Shorten several error messages Markus Armbruster
2024-05-27 11:31 ` [PULL 9/9] qerror: QERR_QGA_COMMAND_FAILED is no longer used, drop Markus Armbruster
2024-05-27 17:15 ` [PULL 0/9] Error reporting patches for 2024-05-27 Richard Henderson

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=20240527113131.2054486-2-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).