aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-12-03 18:20:58 +0000
committerroot <root@ceth6.(none)>2014-12-22 14:39:20 +0800
commitf1839938b090b28537d9be2c1b255b834f3cfbb8 (patch)
treeebeb86523e811daf6ccd5641c427d15e9c4c88b9 /monitor.c
parent703008e81a6ace40f227aae16d630014e5016af1 (diff)
bootdevice: add Error **errp argument for qemu_boot_set()
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 'monitor.c')
-rw-r--r--monitor.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/monitor.c b/monitor.c
index 503cf515ad..1808e41932 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1494,17 +1494,15 @@ static void do_ioport_write(Monitor *mon, const QDict *qdict)
static void do_boot_set(Monitor *mon, const QDict *qdict)
{
- int res;
+ Error *local_err = NULL;
const char *bootdevice = qdict_get_str(qdict, "bootdevice");
- res = qemu_boot_set(bootdevice);
- if (res == 0) {
- monitor_printf(mon, "boot device list now set to %s\n", bootdevice);
- } else if (res > 0) {
- monitor_printf(mon, "setting boot device list failed\n");
+ qemu_boot_set(bootdevice, &local_err);
+ if (local_err) {
+ monitor_printf(mon, "%s\n", error_get_pretty(local_err));
+ error_free(local_err);
} else {
- monitor_printf(mon, "no function defined to set boot device list for "
- "this architecture\n");
+ monitor_printf(mon, "boot device list now set to %s\n", bootdevice);
}
}