mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
QemuOpts: Convert qemu_opts_foreach() to Error
Retain the function value for now, to permit selective conversion of its callers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
a4c7367f7d
commit
28d0de7a4f
12 changed files with 72 additions and 54 deletions
|
@ -219,7 +219,7 @@ struct add_rule_data {
|
|||
Error **errp;
|
||||
};
|
||||
|
||||
static int add_rule(QemuOpts *opts, void *opaque)
|
||||
static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
struct add_rule_data *d = opaque;
|
||||
BDRVBlkdebugState *s = d->s;
|
||||
|
@ -320,7 +320,7 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
|
|||
d.s = s;
|
||||
d.action = ACTION_INJECT_ERROR;
|
||||
d.errp = &local_err;
|
||||
qemu_opts_foreach(&inject_error_opts, add_rule, &d);
|
||||
qemu_opts_foreach(&inject_error_opts, add_rule, &d, NULL);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EINVAL;
|
||||
|
@ -328,7 +328,7 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
|
|||
}
|
||||
|
||||
d.action = ACTION_SET_STATE;
|
||||
qemu_opts_foreach(&set_state_opts, add_rule, &d);
|
||||
qemu_opts_foreach(&set_state_opts, add_rule, &d, NULL);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue