mirror of
https://github.com/mii443/qemu.git
synced 2025-12-09 14:08:32 +00: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:
@@ -670,11 +670,9 @@ void qemu_opts_set(QemuOptsList *list, const char *id,
|
||||
const char *name, const char *value, Error **errp)
|
||||
{
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
|
||||
opts = qemu_opts_create(list, id, 1, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
opts = qemu_opts_create(list, id, 1, errp);
|
||||
if (!opts) {
|
||||
return;
|
||||
}
|
||||
qemu_opt_set(opts, name, value, errp);
|
||||
@@ -1012,10 +1010,8 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,
|
||||
QemuOpts *opts;
|
||||
const QDictEntry *entry;
|
||||
|
||||
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1,
|
||||
&local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1, errp);
|
||||
if (!opts) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user