Only use boot=on on non-ide disks only (KVM)
authorApollon Oikonomopoulos <apoikos@gmail.com>
Wed, 24 Mar 2010 15:41:38 +0000 (17:41 +0200)
committerGuido Trotter <ultrotter@google.com>
Wed, 21 Apr 2010 14:48:53 +0000 (15:48 +0100)
boot=on implies that KVM boots using extboot. This is only required
to boot non-IDE disks and has the side-effect that there is at most
one bootable device. This behaviour breaks some operating systems,
most notably the windows installer that tries to chainload the hard-disk
from the CD-ROM after the initial part of the installation.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/hypervisor/hv_kvm.py

index 469f857..589c08a 100644 (file)
@@ -424,7 +424,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
       # TODO: handle FD_LOOP and FD_BLKTAP (?)
       if boot_disk:
         kvm_cmd.extend(['-boot', 'c'])
-        boot_val = ',boot=on'
+        if disk_type != constants.HT_DISK_IDE:
+            boot_val = ',boot=on'
+        else:
+            boot_val = ''
         # We only boot from the first disk
         boot_disk = False
       else:
@@ -439,9 +442,14 @@ class KVMHypervisor(hv_base.BaseHypervisor):
       options = ',format=raw,media=cdrom'
       if boot_cdrom:
         kvm_cmd.extend(['-boot', 'd'])
-        options = '%s,boot=on' % options
+        if disk_type != constants.HT_DISK_IDE:
+            options = '%s,boot=on' % options
       else:
-        options = '%s,if=virtio' % options
+        if disk_type == constants.HT_DISK_PARAVIRTUAL:
+          if_val = ',if=virtio'
+        else:
+          if_val = ',if=%s' % disk_type
+        options = '%s%s' % (options, if_val)
       drive_val = 'file=%s%s' % (iso_image, options)
       kvm_cmd.extend(['-drive', drive_val])