Commit 4304964a authored by Guido Trotter's avatar Guido Trotter
Browse files

Don't add ",boot=on" to disks on kvm >= 0.14



Under newer kvm this prevents the vm from starting.
Ah, change!
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 3af16328
......@@ -506,6 +506,12 @@ class KVMHypervisor(hv_base.BaseHypervisor):
"""Generate KVM information to start an instance.
"""
kvm_version = self._GetKVMVersion()
if kvm_version:
_, v_major, v_min, _ = kvm_version
else:
raise errors.HypervisorError("Unable to get KVM version")
pidfile = self._InstancePidFile(instance.name)
kvm = constants.KVM_PATH
kvm_cmd = [kvm]
......@@ -548,16 +554,12 @@ class KVMHypervisor(hv_base.BaseHypervisor):
raise errors.HypervisorError("Instance has read-only disks which"
" are not supported by KVM")
# TODO: handle FD_LOOP and FD_BLKTAP (?)
boot_val = ""
if boot_disk:
kvm_cmd.extend(['-boot', 'c'])
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:
boot_val = ''
if (v_major, v_min) < (0, 14) 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,
cache_val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment