mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
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:
parent
6353218b8c
commit
7e1e0c1112
4 changed files with 13 additions and 23 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue