Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
boot: add a new type to halt booting
Current seabios will try to boot from selected devices first,
if they are all failed, seabios will also try to boot from
un-selected devices.

For example:
@ qemu-kvm -boot order=n,menu=on ...

Guest will boot from network first, if it's failed, guest will try to
boot from other un-selected devices (floppy, cdrom, disk) one by one.

We need to make it configurable. This patch added a new type, qemu can
add "HALT" at the end of bootindex string, then seabios will halt
booting after trying to boot from selected devices.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Amos Kong <akong@redhat.com>
  • Loading branch information
amoskong committed Jan 9, 2013
1 parent 261e870 commit 39aeded
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/boot.c
Expand Up @@ -291,6 +291,7 @@ static struct bootentry_s *BootList;
#define IPL_TYPE_CBFS 0x20
#define IPL_TYPE_BEV 0x80
#define IPL_TYPE_BCV 0x81
#define IPL_TYPE_HALT 0xf0

static void
bootentry_add(int type, int prio, u32 data, const char *desc)
Expand Down Expand Up @@ -488,6 +489,11 @@ boot_prep(void)
interactive_bootmenu();
wait_threads();

int haltprio = find_prio("HALT");

if (haltprio >= 0)
bootentry_add(IPL_TYPE_HALT, haltprio, 0, "HALT");

// Map drives and populate BEV list
struct bootentry_s *pos = BootList;
while (pos) {
Expand Down Expand Up @@ -672,6 +678,9 @@ do_boot(int seq_nr)
case IPL_TYPE_BEV:
boot_rom(ie->vector);
break;
case IPL_TYPE_HALT:
boot_fail();
break;
}

// Boot failed: invoke the boot recovery function
Expand Down

0 comments on commit 39aeded

Please sign in to comment.