All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mitake.hitoshi@lab.ntt.co.jp, namei.unix@gmail.com,
	sheepdog@lists.wpkg.org, stefanha@redhat.com, kwolf@redhat.com
Subject: [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
Date: Thu, 12 Feb 2015 14:49:50 +0100	[thread overview]
Message-ID: <1423748990-9709-1-git-send-email-armbru@redhat.com> (raw)

If do_sd_create() fails, it first reports the error returned, then
reports a another one with strerror(errno).  errno is meaningless at
that point.

Report just one error combining the valid information from both
messages.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
Applies on top of my "[PATCH v2 00/10] Clean up around
error_get_pretty(), qerror_report_err()", but rebasing to master would
be trivial.

 block/sheepdog.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 6a4a3bd..0e8c712 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2225,9 +2225,8 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
 
     ret = do_sd_create(s, &new_vid, 1, &local_err);
     if (ret < 0) {
-        error_report_err(local_err);
-        error_report("failed to create inode for snapshot. %s",
-                     strerror(errno));
+        error_report("failed to create inode for snapshot: %s",
+                     error_get_pretty(local_err));
         goto cleanup;
     }
 
-- 
1.9.3

             reply	other threads:[~2015-02-12 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 13:49 Markus Armbruster [this message]
2015-02-12 15:15 ` [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Eric Blake
2015-02-13  3:57 ` Liu Yuan
2015-02-27 12:56 ` Markus Armbruster
2015-03-04 13:03 ` 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=1423748990-9709-1-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.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.