From 9cf4321fc39ec36359d9c90b22b36d33b6adc2f4 Mon Sep 17 00:00:00 2001 From: Apollon Oikonomopoulos Date: Wed, 24 Mar 2010 17:41:38 +0200 Subject: [PATCH] Only use boot=on on non-ide disks only (KVM) 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 Reviewed-by: Guido Trotter --- lib/hypervisor/hv_kvm.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 469f857..589c08a 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -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]) -- 1.7.10.4