[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 43/45] qemu-img: Ignore Error objects where the return value s
From: |
Markus Armbruster |
Subject: |
[PATCH v4 43/45] qemu-img: Ignore Error objects where the return value suffices |
Date: |
Tue, 7 Jul 2020 18:06:11 +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 fc405ee171..a6af0eaf80 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 v4 17/45] qapi: Make visitor functions taking Error ** return bool, not void, (continued)
- [PATCH v4 17/45] qapi: Make visitor functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/07
- [PATCH v4 22/45] qom: Rename qdev_get_type() to object_get_type(), Markus Armbruster, 2020/07/07
- [PATCH v4 45/45] hmp: Ignore Error objects where the return value suffices, Markus Armbruster, 2020/07/07
- [PATCH v4 37/45] error: Reduce unnecessary error propagation, Markus Armbruster, 2020/07/07
- [PATCH v4 39/45] qapi: Smooth another visitor error checking pattern, Markus Armbruster, 2020/07/07
- [PATCH v4 21/45] qom: Use error_reportf_err() instead of g_printerr() in examples, Markus Armbruster, 2020/07/07
- [PATCH v4 02/45] error: Improve error.h's big comment, Markus Armbruster, 2020/07/07
- [PATCH v4 25/45] qom: Use return values to check for error where that's simpler, Markus Armbruster, 2020/07/07
- [PATCH v4 43/45] qemu-img: Ignore Error objects where the return value suffices,
Markus Armbruster <=
- Re: [PATCH v4 00/45] Less clumsy error checking, Markus Armbruster, 2020/07/07
- Re: [PATCH v4 00/45] Less clumsy error checking, no-reply, 2020/07/07