qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Reda Sallahi <fullmanet@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>, Fam Zheng <famz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-trivial@nongnu.org, Reda Sallahi <fullmanet@gmail.com>
Subject: [Qemu-trivial] [PATCH] qemu-img: fix error messages emitted by img_open()
Date: Thu, 21 Jul 2016 10:41:53 +0200	[thread overview]
Message-ID: <20160721084153.16103-1-fullmanet@gmail.com> (raw)

img_open_file() and img_open_opts() were printing error messages with a
duplicate part because of a wrong use of error_reportf_err() (e.g.
qemu-img: Could not open 'foo': Could not open 'foo': No such file or directory)

This change uses error_report_err() instead to eliminate the duplicate part.

Signed-off-by: Reda Sallahi <fullmanet@gmail.com>
---
 qemu-img.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 2e40e1f..dc6652d 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -268,7 +268,7 @@ static BlockBackend *img_open_opts(const char *optstr,
     options = qemu_opts_to_qdict(opts, NULL);
     blk = blk_new_open(NULL, NULL, options, flags, &local_err);
     if (!blk) {
-        error_reportf_err(local_err, "Could not open '%s': ", optstr);
+        error_report_err(local_err);
         return NULL;
     }
     blk_set_enable_write_cache(blk, !writethrough);
@@ -295,7 +295,7 @@ static BlockBackend *img_open_file(const char *filename,
 
     blk = blk_new_open(filename, NULL, options, flags, &local_err);
     if (!blk) {
-        error_reportf_err(local_err, "Could not open '%s': ", filename);
+        error_report(local_err);
         return NULL;
     }
     blk_set_enable_write_cache(blk, !writethrough);
-- 
2.9.0



             reply	other threads:[~2016-07-21 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  8:41 Reda Sallahi [this message]
2016-07-21  9:07 ` [Qemu-trivial] [PATCH] qemu-img: fix error messages emitted by img_open() Stefan Hajnoczi
2016-07-25 15:58   ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2016-07-26 13:07     ` 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=20160721084153.16103-1-fullmanet@gmail.com \
    --to=fullmanet@gmail.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 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).