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> --- qemu-io.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'qemu-io.c') diff --git a/qemu-io.c b/qemu-io.c index 13829f5e21..6df7731af4 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -620,11 +620,9 @@ int main(int argc, char **argv) exit(1); } - if (qemu_opts_foreach(&qemu_object_opts, - user_creatable_add_opts_foreach, - NULL, NULL)) { - exit(1); - } + qemu_opts_foreach(&qemu_object_opts, + user_creatable_add_opts_foreach, + NULL, &error_fatal); if (!trace_init_backends()) { exit(1); -- cgit v1.2.3