public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: kvm-devel@lists.sourceforge.net
Cc: Mark McLoughlin <markmc@redhat.com>
Subject: [PATCH] kvm: qemu: Allow booting from extboot drive with -kernel
Date: Tue, 29 Apr 2008 11:42:16 +0100	[thread overview]
Message-ID: <1209465736-13617-1-git-send-email-markmc@redhat.com> (raw)

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.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 qemu/hw/pc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index 48a36e0..506ef6b 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -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);
     }
-- 
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

             reply	other threads:[~2008-04-29 10:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 10:42 Mark McLoughlin [this message]
2008-05-02 10:41 ` [PATCH] kvm: qemu: Allow booting from extboot drive with -kernel Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1209465736-13617-1-git-send-email-markmc@redhat.com \
    --to=markmc@redhat.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox