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>
}
}
- opts = qemu_opts_create(¶llels_runtime_opts, NULL, 0, &local_err);
- if (local_err != NULL) {
+ opts = qemu_opts_create(¶llels_runtime_opts, NULL, 0, errp);
+ if (!opts) {
goto fail_options;
}
/* Check common options by copying from bs_opts to opts, all other options
* stay in bs_opts for processing by bdrv_open(). */
id = qdict_get_try_str(bs_opts, "id");
- opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
- if (error) {
- error_propagate(errp, error);
+ opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, errp);
+ if (!opts) {
goto err_no_opts;
}
QemuOpts *opts;
DeviceState *dev;
- opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
+ opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, errp);
+ if (!opts) {
return;
}
if (!monitor_cur_is_qmp() && qdev_device_help(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;
}
}
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;
}
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);
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;
}