Revision 4304964a lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
506 | 506 |
"""Generate KVM information to start an instance. |
507 | 507 |
|
508 | 508 |
""" |
509 |
kvm_version = self._GetKVMVersion() |
|
510 |
if kvm_version: |
|
511 |
_, v_major, v_min, _ = kvm_version |
|
512 |
else: |
|
513 |
raise errors.HypervisorError("Unable to get KVM version") |
|
514 |
|
|
509 | 515 |
pidfile = self._InstancePidFile(instance.name) |
510 | 516 |
kvm = constants.KVM_PATH |
511 | 517 |
kvm_cmd = [kvm] |
... | ... | |
548 | 554 |
raise errors.HypervisorError("Instance has read-only disks which" |
549 | 555 |
" are not supported by KVM") |
550 | 556 |
# TODO: handle FD_LOOP and FD_BLKTAP (?) |
557 |
boot_val = "" |
|
551 | 558 |
if boot_disk: |
552 | 559 |
kvm_cmd.extend(['-boot', 'c']) |
553 |
if disk_type != constants.HT_DISK_IDE: |
|
554 |
boot_val = ',boot=on' |
|
555 |
else: |
|
556 |
boot_val = '' |
|
557 |
# We only boot from the first disk |
|
558 | 560 |
boot_disk = False |
559 |
else:
|
|
560 |
boot_val = ''
|
|
561 |
if (v_major, v_min) < (0, 14) and disk_type != constants.HT_DISK_IDE:
|
|
562 |
boot_val = ",boot=on"
|
|
561 | 563 |
|
562 | 564 |
drive_val = 'file=%s,format=raw%s%s%s' % (dev_path, if_val, boot_val, |
563 | 565 |
cache_val) |
Also available in: Unified diff