qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/28] qemu-img: stop printing error twice in a few places


From: Michael Tokarev
Subject: [PATCH 01/28] qemu-img: stop printing error twice in a few places
Date: Thu, 22 Feb 2024 00:15:42 +0300

Currently we have:

  ./qemu-img resize none +10
  qemu-img: Could not open 'none': Could not open 'none': No such file or 
directory

stop printing the message twice, - local_err already has
all the info, no need to prepend additional text there.

There are a few other places like this, but I'm unsure
about these.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-img.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 7668f86769..5a756be600 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -404,7 +404,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_err(local_err);
         return NULL;
     }
     blk_set_enable_write_cache(blk, !writethrough);
@@ -597,7 +597,7 @@ static int img_create(int argc, char **argv)
     bdrv_img_create(filename, fmt, base_filename, base_fmt,
                     options, img_size, flags, quiet, &local_err);
     if (local_err) {
-        error_reportf_err(local_err, "%s: ", filename);
+        error_report_err(local_err);
         goto fail;
     }
 
@@ -5253,9 +5253,7 @@ static int img_dd(int argc, char **argv)
 
     ret = bdrv_create(drv, out.filename, opts, &local_err);
     if (ret < 0) {
-        error_reportf_err(local_err,
-                          "%s: error while creating output image: ",
-                          out.filename);
+        error_report_err(local_err);
         ret = -1;
         goto out;
     }
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]