diff mbox

block: Restore extboot functionality after mismerge

Message ID 1278331370-26353-1-git-send-email-stefanha@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Hajnoczi July 5, 2010, 12:02 p.m. UTC
None
diff mbox

Patch

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) {