[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 42/44] qemu-img: Ignore Error objects where the return value s
From: |
Markus Armbruster |
Subject: |
[PATCH v2 42/44] qemu-img: Ignore Error objects where the return value suffices |
Date: |
Thu, 2 Jul 2020 17:49:58 +0200 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
qemu-img.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 27bf94e7ae..c11bfe0268 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -464,22 +464,18 @@ static int add_old_style_options(const char *fmt,
QemuOpts *opts,
const char *base_filename,
const char *base_fmt)
{
- Error *err = NULL;
-
if (base_filename) {
if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
- &err)) {
+ NULL)) {
error_report("Backing file not supported for file format '%s'",
fmt);
- error_free(err);
return -1;
}
}
if (base_fmt) {
- if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err)) {
+ if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, NULL)) {
error_report("Backing file format not supported for file "
"format '%s'", fmt);
- error_free(err);
return -1;
}
}
--
2.26.2
- [PATCH v2 06/44] qemu-option: Check return value instead of @err where convenient, (continued)
- [PATCH v2 06/44] qemu-option: Check return value instead of @err where convenient, Markus Armbruster, 2020/07/02
- [PATCH v2 22/44] qom: Rename qdev_get_type() to object_get_type(), Markus Armbruster, 2020/07/02
- [PATCH v2 31/44] qdev: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/02
- [PATCH v2 44/44] hmp: Ignore Error objects where the return value suffices, Markus Armbruster, 2020/07/02
- [PATCH v2 19/44] block/parallels: Simplify parallels_open() after previous commit, Markus Armbruster, 2020/07/02
- [PATCH v2 27/44] qom: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/02
- [PATCH v2 10/44] qemu-option: Factor out helper opt_create(), Markus Armbruster, 2020/07/02
- [PATCH v2 42/44] qemu-img: Ignore Error objects where the return value suffices,
Markus Armbruster <=
- [PATCH v2 37/44] error: Reduce unnecessary error propagation, Markus Armbruster, 2020/07/02
- [PATCH v2 16/44] qapi: Make visitor functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/02
- [PATCH v2 30/44] qom: Make functions taking Error ** return bool, not 0/-1, Markus Armbruster, 2020/07/02
- [PATCH v2 07/44] qemu-option: Make uses of find_desc_by_name() more similar, Markus Armbruster, 2020/07/02
- [PATCH v2 18/44] qapi: Use returned bool to check for failure, manual part, Markus Armbruster, 2020/07/02