qemu-option: Make functions taking Error ** return bool, not void

See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-14-armbru@redhat.com>
This commit is contained in:
Markus Armbruster
2020-07-07 18:05:41 +02:00
parent 64af7a8bad
commit c75d7f7191
3 changed files with 64 additions and 49 deletions

View File

@ -705,7 +705,7 @@ BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
: QTAILQ_FIRST(&monitor_bdrv_states);
}
static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
static bool qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
Error **errp)
{
const char *value;
@ -715,7 +715,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
if (qemu_opt_find(opts, to)) {
error_setg(errp, "'%s' and its alias '%s' can't be used at the "
"same time", to, from);
return;
return false;
}
}
@ -724,6 +724,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
qemu_opt_set(opts, to, value, &error_abort);
qemu_opt_unset(opts, from);
}
return true;
}
QemuOptsList qemu_legacy_drive_opts = {