From 703008e81a6ace40f227aae16d630014e5016af1 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Wed, 3 Dec 2014 17:11:39 +0000 Subject: 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 Reviewed-by: Markus Armbruster --- vl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'vl.c') 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); -- cgit v1.2.3