Skip to contentSkip to conversation

kvm: qemu: Allow booting from extboot drive with -kernel

PATCH Applied Mark McLoughlin 2 participants 2 messages Apr 29, 2008 – May 2, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: qemu: Allow booting from extboot drive with -kernel

The -kernel option generates a new boot sector for the boot drive which jumps directly to the supplied kernel rather than running the standard bootloader.

Trivially fix generate_bootsect() to handle the
case where we're booting using extboot.

---
 qemu/hw/pc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
qemu/hw/pc.c +4 -3
index 48a36e0..506ef6b 100644
@@ -405,11 +405,12 @@ static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
 {
     uint8_t bootsect[512], *p;
     int i;
-    int hda;
+    int hda = extboot_drive;
 
-    hda = drive_get_index(IF_IDE, 0, 0);
+    if (hda == -1)
+      hda = drive_get_index(IF_IDE, 0, 0);
     if (hda == -1) {
-	fprintf(stderr, "A disk image must be given for 'hda' when booting "
+	fprintf(stderr, "-hda or -drive boot=on must be given when booting "
 		"a Linux kernel\n");
 	exit(1);
     }
Signature · 8 lines
1.5.4.1


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Applied
#1 lore raw
Quoted 8 lines · Mark McLoughlin

The -kernel option generates a new boot sector for the boot drive which jumps directly to the supplied kernel rather than running the standard bootloader.

Trivially fix generate_bootsect() to handle the case where we're booting using extboot.

Applied, thanks.

Signature · 9 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone