diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-12 17:52:20 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-02-26 14:49:31 +0100 |
commit | f43e47dbf6de24db20ec9b588bb6cc762093dd69 (patch) | |
tree | e6236f3afaabde624458eab11e8daaa7e0dd4878 /util/qemu-config.c | |
parent | 6be4194b9215ed29f258543ce34a1b4b2003864d (diff) |
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>
Diffstat (limited to 'util/qemu-config.c')
-rw-r--r-- | util/qemu-config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/util/qemu-config.c b/util/qemu-config.c index b13efe2788..f3463df678 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -219,6 +219,7 @@ void qemu_add_opts(QemuOptsList *list) int qemu_set_option(const char *str) { + Error *local_err = NULL; char group[64], id[64], arg[64]; QemuOptsList *list; QemuOpts *opts; @@ -242,7 +243,9 @@ int qemu_set_option(const char *str) return -1; } - if (qemu_opt_set(opts, arg, str+offset+1) == -1) { + qemu_opt_set(opts, arg, str + offset + 1, &local_err); + if (local_err) { + error_report_err(local_err); return -1; } return 0; @@ -335,7 +338,9 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname) error_report("no group defined"); goto out; } - if (qemu_opt_set(opts, arg, value) != 0) { + qemu_opt_set(opts, arg, value, &local_err); + if (local_err) { + error_report_err(local_err); goto out; } continue; |