mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
qemu_opt_set() is a wrapper around qemu_opt_set() that reports the error with qerror_report_err(). Most of its users assume the function can't fail. Make them use qemu_opt_set_err() with &error_abort, so that should the assumption ever break, it'll break noisily. Just two users remain, in util/qemu-config.c. Switch them to qemu_opt_set_err() as well, then rename qemu_opt_set_err() to qemu_opt_set(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
6be4194b92
commit
f43e47dbf6
18 changed files with 131 additions and 131 deletions
|
@ -548,22 +548,8 @@ static void opt_set(QemuOpts *opts, const char *name, const char *value,
|
|||
}
|
||||
}
|
||||
|
||||
int qemu_opt_set(QemuOpts *opts, const char *name, const char *value)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
|
||||
opt_set(opts, name, value, false, &local_err);
|
||||
if (local_err) {
|
||||
qerror_report_err(local_err);
|
||||
error_free(local_err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void qemu_opt_set_err(QemuOpts *opts, const char *name, const char *value,
|
||||
Error **errp)
|
||||
void qemu_opt_set(QemuOpts *opts, const char *name, const char *value,
|
||||
Error **errp)
|
||||
{
|
||||
opt_set(opts, name, value, false, errp);
|
||||
}
|
||||
|
@ -701,7 +687,7 @@ void qemu_opts_set(QemuOptsList *list, const char *id,
|
|||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
qemu_opt_set_err(opts, name, value, errp);
|
||||
qemu_opt_set(opts, name, value, errp);
|
||||
}
|
||||
|
||||
const char *qemu_opts_id(QemuOpts *opts)
|
||||
|
@ -921,7 +907,7 @@ static void qemu_opts_from_qdict_1(const char *key, QObject *obj, void *opaque)
|
|||
return;
|
||||
}
|
||||
|
||||
qemu_opt_set_err(state->opts, key, value, state->errp);
|
||||
qemu_opt_set(state->opts, key, value, state->errp);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue