qom: Clean up error reporting in user_creatable_add_opts_foreach()

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é <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20181017082702.5581-20-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2018-10-17 10:26:43 +02:00
parent 6353218b8c
commit 7e1e0c1112
4 changed files with 13 additions and 23 deletions

View file

@ -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);