[PATCH] block: Restore extboot functionality after mismerge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

  commit 666daa68234b5b1758652633cab07d5ca6046a5b
  Author: Markus Armbruster <armbru@xxxxxxxxxx>
  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@xxxxxxxxxx>
  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@xxxxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux