summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-12-03 17:11:39 +0000
committerroot <root@ceth6.(none)>2014-12-22 14:39:20 +0800
commit703008e81a6ace40f227aae16d630014e5016af1 (patch)
treec515ae6d62765dd51094e9063e125bb8bdc3bac9 /vl.c
parent9816833d3b8ec9adfb63b6a53f1b56f5304f4c40 (diff)
downloadqemu-703008e81a6ace40f227aae16d630014e5016af1.zip
bootdevice: add Error **errp argument for validate_bootdevices()
It will be useful for checking when we change traditional boot order dynamically and propagate error message to the monitor. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index f665621f12..a824a7d8b4 100644
--- a/vl.c
+++ b/vl.c
@@ -4087,16 +4087,25 @@ int main(int argc, char **argv, char **envp)
if (opts) {
char *normal_boot_order;
const char *order, *once;
+ Error *local_err = NULL;
order = qemu_opt_get(opts, "order");
if (order) {
- validate_bootdevices(order);
+ validate_bootdevices(order, &local_err);
+ if (local_err) {
+ error_report("%s", error_get_pretty(local_err));
+ exit(1);
+ }
boot_order = order;
}
once = qemu_opt_get(opts, "once");
if (once) {
- validate_bootdevices(once);
+ validate_bootdevices(once, &local_err);
+ if (local_err) {
+ error_report("%s", error_get_pretty(local_err));
+ exit(1);
+ }
normal_boot_order = g_strdup(boot_order);
boot_order = once;
qemu_register_reset(restore_boot_order, normal_boot_order);