mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-27 03:51:57 -06:00
qemu-option: Check return value instead of @err where convenient
Convert uses like opts = qemu_opts_create(..., &err); if (err) { ... } to opts = qemu_opts_create(..., errp); if (!opts) { ... } Eliminate error_propagate() that are now unnecessary. Delete @err that are now unused. Note that we can't drop parallels_open()'s error_propagate() here. We continue to execute it even in the converted case. It's a no-op then: local_err is null. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <20200707160613.848843-8-armbru@redhat.com>
This commit is contained in:
parent
79c3e2bc6e
commit
c6ecec43b2
5 changed files with 14 additions and 22 deletions
|
@ -493,9 +493,8 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
|
|||
goto out;
|
||||
}
|
||||
|
||||
subopts = qemu_opts_create(opts, NULL, 0, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
subopts = qemu_opts_create(opts, NULL, 0, errp);
|
||||
if (!subopts) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -538,10 +537,9 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
|
|||
}
|
||||
|
||||
opt_name = g_strdup_printf("%s.%u", opts->name, i++);
|
||||
subopts = qemu_opts_create(opts, opt_name, 1, &local_err);
|
||||
subopts = qemu_opts_create(opts, opt_name, 1, errp);
|
||||
g_free(opt_name);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!subopts) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue