kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: <kvm@vger.kernel.org>
Cc: Avi Kivity <avi@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [PATCH] block: Restore extboot functionality after mismerge
Date: Mon,  5 Jul 2010 13:02:50 +0100	[thread overview]
Message-ID: <1278331370-26353-1-git-send-email-stefanha@linux.vnet.ibm.com> (raw)

Extboot if=virtio,boot=on is broken due to a mismerge of:

  commit 666daa68234b5b1758652633cab07d5ca6046a5b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   Wed Jun 2 18:48:27 2010 +0200

      blockdev: Collect block device code in new blockdev.c

in:

  commit 55cbee9e738bfe7434081967f884209f1a9c994c
  Merge: a854beb 666daa6
  Author: Avi Kivity <avi@redhat.com>
  Date:   Mon Jun 21 17:29:02 2010 +0300

      Merge commit '666daa68234b5b1758652633cab07d5ca6046a5b' into
      upstream-merge

The extboot_drive global is no longer being initialized in drive_init().
This patch restores the code to initialize extboot_drive.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 blockdev.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 90472a9..965a089 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -141,6 +141,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
     int on_read_error, on_write_error;
     const char *devaddr;
     DriveInfo *dinfo;
+    int is_extboot = 0;
     int snapshot = 0;
     int ret;
 
@@ -302,6 +303,12 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
         }
     }
 
+    is_extboot = qemu_opt_get_bool(opts, "boot", 0);
+    if (is_extboot && extboot_drive) {
+        fprintf(stderr, "qemu: two bootable drives specified\n");
+        return NULL;
+    }
+
     on_write_error = BLOCK_ERR_STOP_ENOSPC;
     if ((buf = qemu_opt_get(opts, "werror")) != NULL) {
         if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO && type != IF_NONE) {
@@ -412,6 +419,10 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
         strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1);
     QTAILQ_INSERT_TAIL(&drives, dinfo, next);
 
+    if (is_extboot) {
+        extboot_drive = dinfo;
+    }
+
     bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error);
 
     switch(type) {
-- 
1.7.1


             reply	other threads:[~2010-07-05 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05 12:02 Stefan Hajnoczi [this message]
2010-07-05 12:40 ` [PATCH] block: Restore extboot functionality after mismerge 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=1278331370-26353-1-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).