diff options
author | Gonglei <arei.gonglei@huawei.com> | 2014-12-03 18:25:46 +0000 |
---|---|---|
committer | root <root@ceth6.(none)> | 2014-12-22 14:39:21 +0800 |
commit | 3b08098b409c0fb28f85436ba1adeb1d401ec8f7 (patch) | |
tree | 1e87a86f4441cab29f8b3c6c51b6cb1f4c509a1c /bootdevice.c | |
parent | f1839938b090b28537d9be2c1b255b834f3cfbb8 (diff) |
bootdevice: add validate check for qemu_boot_set()
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'bootdevice.c')
-rw-r--r-- | bootdevice.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bootdevice.c b/bootdevice.c index 7f07507a95..9de34babb0 100644 --- a/bootdevice.c +++ b/bootdevice.c @@ -49,12 +49,20 @@ void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque) void qemu_boot_set(const char *boot_order, Error **errp) { + Error *local_err = NULL; + if (!boot_set_handler) { error_setg(errp, "no function defined to set boot device list for" " this architecture"); return; } + validate_bootdevices(boot_order, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + if (boot_set_handler(boot_set_opaque, boot_order)) { error_setg(errp, "setting boot device list failed"); return; |