[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
- Re: [PATCH 04/28] qemu-img: global option processing and error printing, (continued)
[PATCH 03/28] qemu-img: create: convert img_size to signed, simplify handling, Michael Tokarev, 2024/02/21
[PATCH 06/28] qemu-img: create: refresh options/--help, Michael Tokarev, 2024/02/21
[PATCH 01/28] qemu-img: stop printing error twice in a few places,
Michael Tokarev <=
[PATCH 05/28] qemu-img: pass current cmd info into command handlers, Michael Tokarev, 2024/02/21
[PATCH 02/28] qemu-img: measure: convert img_size to signed, simplify handling, Michael Tokarev, 2024/02/21
[PATCH 09/28] qemu-img: simplify --repair error message, Michael Tokarev, 2024/02/21
[PATCH 07/28] qemu-img: factor out parse_output_format() and use it in the code, Michael Tokarev, 2024/02/21
[PATCH 08/28] qemu-img: check: refresh options/--help, Michael Tokarev, 2024/02/21