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:
Markus Armbruster 2015-02-12 17:52:20 +01:00
parent 6be4194b92
commit f43e47dbf6
18 changed files with 131 additions and 131 deletions

View file

@ -335,7 +335,7 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
Error *err = NULL;
if (base_filename) {
qemu_opt_set_err(opts, BLOCK_OPT_BACKING_FILE, base_filename, &err);
qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &err);
if (err) {
error_report("Backing file not supported for file format '%s'",
fmt);
@ -344,7 +344,7 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
}
}
if (base_fmt) {
qemu_opt_set_err(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err);
qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err);
if (err) {
error_report("Backing file format not supported for file "
"format '%s'", fmt);
@ -2828,7 +2828,7 @@ static int img_resize(int argc, char **argv)
/* Parse size */
param = qemu_opts_create(&resize_options, NULL, 0, &error_abort);
qemu_opt_set_err(param, BLOCK_OPT_SIZE, size, &err);
qemu_opt_set(param, BLOCK_OPT_SIZE, size, &err);
if (err) {
error_report_err(err);
ret = -1;