]> git.proxmox.com Git - mirror_qemu.git/commit - vl.c
bootdevice: check boot order argument validation before vm running
authorGonglei <arei.gonglei@huawei.com>
Tue, 3 Feb 2015 11:31:09 +0000 (11:31 +0000)
committerLili <huanglili.huang@huawei.com>
Tue, 3 Mar 2015 05:13:21 +0000 (13:13 +0800)
commitf05f47bb5f07ca32a23edf1df3dd75f5004f9325
tree0c0752a53db1d4c3a6b6a2ee3060738ffccf1812
parent0856579cac2f1dacecd847cfcd89680d26ff78f5
bootdevice: check boot order argument validation before vm running

Either 'once' option or 'order' option can take effect for -boot at
the same time, that is say initial startup processing can check only
one. And pc.c's set_boot_dev() fails when its boot order argument
is invalid. This patch provide a solution fix this problem:

 1. If "once" is given, register reset handler to restore boot order.

 2. Pass the normal boot order to machine creation.  Should fail when
   the normal boot order is invalid.

 3. If "once" is given, set it with qemu_boot_set().  Fails when the
   once boot order is invalid.

 4. Start the machine.

 5. On reset, the reset handler calls qemu_boot_set() to restore boot
   order.  Should never fail.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
vl.c