Revision ea0f3d7a lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
74 | 74 |
hv_base.ParamInSet(False, constants.HT_KVM_VALID_MOUSE_TYPES), |
75 | 75 |
constants.HV_MIGRATION_PORT: hv_base.NET_PORT_CHECK, |
76 | 76 |
constants.HV_USE_LOCALTIME: hv_base.NO_CHECK, |
77 |
constants.HV_DISK_CACHE: |
|
78 |
hv_base.ParamInSet(True, constants.HT_VALID_CACHE_TYPES), |
|
77 | 79 |
} |
78 | 80 |
|
79 | 81 |
_MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)', |
... | ... | |
310 | 312 |
if_val = ',if=virtio' |
311 | 313 |
else: |
312 | 314 |
if_val = ',if=%s' % disk_type |
315 |
# Cache mode |
|
316 |
disk_cache = hvp[constants.HV_DISK_CACHE] |
|
317 |
if disk_cache != constants.HT_CACHE_DEFAULT: |
|
318 |
cache_val = ",cache=%s" % disk_cache |
|
319 |
else: |
|
320 |
cache_val = "" |
|
313 | 321 |
for cfdev, dev_path in block_devices: |
314 | 322 |
if cfdev.mode != constants.DISK_RDWR: |
315 | 323 |
raise errors.HypervisorError("Instance has read-only disks which" |
... | ... | |
323 | 331 |
else: |
324 | 332 |
boot_val = '' |
325 | 333 |
|
326 |
drive_val = 'file=%s,format=raw%s%s' % (dev_path, if_val, boot_val) |
|
334 |
drive_val = 'file=%s,format=raw%s%s%s' % (dev_path, if_val, boot_val, |
|
335 |
cache_val) |
|
327 | 336 |
kvm_cmd.extend(['-drive', drive_val]) |
328 | 337 |
|
329 | 338 |
iso_image = hvp[constants.HV_CDROM_IMAGE_PATH] |
Also available in: Unified diff