From 7e1e0c11127bde81cff260fc6859690435c509d6 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 17 Oct 2018 10:26:43 +0200 Subject: qom: Clean up error reporting in user_creatable_add_opts_foreach() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling error_report() in a function that takes an Error ** argument is suspicious. user_creatable_add_opts_foreach() does that, and then fails without setting an error. Its caller main(), via qemu_opts_foreach(), is fine with it, but clean it up anyway. Cc: Daniel P. Berrangé Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Message-Id: <20181017082702.5581-20-armbru@redhat.com> --- qom/object_interfaces.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'qom/object_interfaces.c') diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 941fd63afd..97b79b48bb 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -143,7 +143,6 @@ int user_creatable_add_opts_foreach(void *opaque, QemuOpts *opts, Error **errp) { bool (*type_opt_predicate)(const char *, QemuOpts *) = opaque; Object *obj = NULL; - Error *err = NULL; const char *type; type = qemu_opt_get(opts, "qom-type"); @@ -152,9 +151,8 @@ int user_creatable_add_opts_foreach(void *opaque, QemuOpts *opts, Error **errp) return 0; } - obj = user_creatable_add_opts(opts, &err); + obj = user_creatable_add_opts(opts, errp); if (!obj) { - error_report_err(err); return -1; } object_unref(obj); -- cgit v1.2.3