diff --git a/NEWS b/NEWS index 028e7b05d6a880c968bfb3961c6d2e0fc372175f..114156162b5b9f2740793ec39faea3871ac833f2 100644 --- a/NEWS +++ b/NEWS @@ -413,6 +413,26 @@ Plus integrated fixes from the 2.5 branch: - KVM live migration when using a custom keymap +Version 2.5.2 +------------- + +*(Released Tue, 24 Jul 2012)* + +A small bugfix release, with no new features: + +- fixed bash-isms in kvm-ifup, for compatibility with systems which use a + different default shell (e.g. Debian, Ubuntu) +- fixed KVM startup and live migration with a custom keymap (fixes Issue + 243 and Debian bug #650664) +- fixed compatibility with KVM versions that don't support multiple boot + devices (fixes Issue 230 and Debian bug #624256) + +Additionally, a few fixes were done to the build system (fixed parallel +build failures) and to the unittests (fixed race condition in test for +FileID functions, and the default enable/disable mode for QA test is now +customisable). + + Version 2.5.1 ------------- diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 087939e95574182d83ff0ff067ea60fa9374b6f6..5ef9cc50cefe479c76c14745937124d62e34d6cc 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -973,10 +973,14 @@ class KVMHypervisor(hv_base.BaseHypervisor): kvm_cmd.extend(["-no-reboot"]) hvp = instance.hvparams - boot_disk = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_DISK - boot_cdrom = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_CDROM - boot_floppy = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_FLOPPY - boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK + kernel_path = hvp[constants.HV_KERNEL_PATH] + if kernel_path: + boot_disk = boot_cdrom = boot_floppy = boot_network = False + else: + boot_disk = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_DISK + boot_cdrom = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_CDROM + boot_floppy = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_FLOPPY + boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK self.ValidateParameters(hvp) @@ -991,6 +995,10 @@ class KVMHypervisor(hv_base.BaseHypervisor): if boot_network: kvm_cmd.extend(["-boot", "n"]) + # whether this is an older KVM version that uses the boot=on flag + # on devices + needs_boot_flag = (v_major, v_min) < (0, 14) + disk_type = hvp[constants.HV_DISK_TYPE] if disk_type == constants.HT_DISK_PARAVIRTUAL: if_val = ",if=virtio" @@ -1018,7 +1026,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): if boot_disk: kvm_cmd.extend(["-boot", "c"]) boot_disk = False - if (v_major, v_min) < (0, 14) and disk_type != constants.HT_DISK_IDE: + if needs_boot_flag and disk_type != constants.HT_DISK_IDE: boot_val = ",boot=on" drive_val = "file=%s,format=raw%s%s%s" % (dev_path, if_val, boot_val, @@ -1033,19 +1041,22 @@ class KVMHypervisor(hv_base.BaseHypervisor): iso_image = hvp[constants.HV_CDROM_IMAGE_PATH] if iso_image: options = ",format=raw,media=cdrom" + # set cdrom 'if' type if boot_cdrom: - kvm_cmd.extend(["-boot", "d"]) - if cdrom_disk_type != constants.HT_DISK_IDE: - options = "%s,boot=on,if=%s" % (options, constants.HT_DISK_IDE) - else: - options = "%s,boot=on" % options + actual_cdrom_type = constants.HT_DISK_IDE + elif cdrom_disk_type == constants.HT_DISK_PARAVIRTUAL: + actual_cdrom_type = "virtio" else: - if cdrom_disk_type == constants.HT_DISK_PARAVIRTUAL: - if_val = ",if=virtio" - else: - if_val = ",if=%s" % cdrom_disk_type - options = "%s%s" % (options, if_val) - drive_val = "file=%s%s" % (iso_image, options) + actual_cdrom_type = cdrom_disk_type + if_val = ",if=%s" % actual_cdrom_type + # set boot flag, if needed + boot_val = "" + if boot_cdrom: + kvm_cmd.extend(["-boot", "d"]) + if needs_boot_flag: + boot_val = ",boot=on" + # and finally build the entire '-drive' value + drive_val = "file=%s%s%s%s" % (iso_image, options, if_val, boot_val) kvm_cmd.extend(["-drive", drive_val]) iso_image2 = hvp[constants.HV_KVM_CDROM2_IMAGE_PATH] @@ -1055,8 +1066,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): if_val = ",if=virtio" else: if_val = ",if=%s" % cdrom_disk_type - options = "%s%s" % (options, if_val) - drive_val = "file=%s%s" % (iso_image2, options) + drive_val = "file=%s%s%s" % (iso_image2, options, if_val) kvm_cmd.extend(["-drive", drive_val]) floppy_image = hvp[constants.HV_KVM_FLOPPY_IMAGE_PATH] @@ -1070,7 +1080,6 @@ class KVMHypervisor(hv_base.BaseHypervisor): drive_val = "file=%s%s" % (floppy_image, options) kvm_cmd.extend(["-drive", drive_val]) - kernel_path = hvp[constants.HV_KERNEL_PATH] if kernel_path: kvm_cmd.extend(["-kernel", kernel_path]) initrd_path = hvp[constants.HV_INITRD_PATH] diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index 77bec0d5435e5537e46e1a9442d04ff605c5c4af..2d27bfd8890d9994390499b97f9cd6f120f05307 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -190,9 +190,11 @@ boot\_order as 'dc'. For KVM the boot order is either "floppy", "cdrom", "disk" or - "network". Please note that older versions of KVM couldn't - netboot from virtio interfaces. This has been fixed in more recent - versions and is confirmed to work at least with qemu-kvm 0.11.1. + "network". Please note that older versions of KVM couldn't netboot + from virtio interfaces. This has been fixed in more recent versions + and is confirmed to work at least with qemu-kvm 0.11.1. Also note + that if you have set the ``kernel_path`` option, that will be used + for booting, and this setting will be silently ignored. blockdev\_prefix Valid for the Xen HVM and PVM hypervisors. @@ -411,9 +413,10 @@ kernel\_path Valid for the Xen PVM and KVM hypervisors. This option specifies the path (on the node) to the kernel to boot - the instance with. Xen PVM instances always require this, while - for KVM if this option is empty, it will cause the machine to load - the kernel from its disks. + the instance with. Xen PVM instances always require this, while for + KVM if this option is empty, it will cause the machine to load the + kernel from its disks (and the boot will be done accordingly to + ``boot_order``). kernel\_args Valid for the Xen PVM and KVM hypervisors.