Revision 19572932 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+)', |
... | ... | |
312 | 314 |
if_val = ',if=virtio' |
313 | 315 |
else: |
314 | 316 |
if_val = ',if=%s' % disk_type |
317 |
# Cache mode |
|
318 |
disk_cache = hvp[constants.HV_DISK_CACHE] |
|
319 |
if disk_cache != constants.HT_CACHE_DEFAULT: |
|
320 |
cache_val = ",cache=%s" % disk_cache |
|
321 |
else: |
|
322 |
cache_val = "" |
|
315 | 323 |
for cfdev, dev_path in block_devices: |
316 | 324 |
if cfdev.mode != constants.DISK_RDWR: |
317 | 325 |
raise errors.HypervisorError("Instance has read-only disks which" |
... | ... | |
325 | 333 |
else: |
326 | 334 |
boot_val = '' |
327 | 335 |
|
328 |
drive_val = 'file=%s,format=raw%s%s' % (dev_path, if_val, boot_val) |
|
336 |
drive_val = 'file=%s,format=raw%s%s%s' % (dev_path, if_val, boot_val, |
|
337 |
cache_val) |
|
329 | 338 |
kvm_cmd.extend(['-drive', drive_val]) |
330 | 339 |
|
331 | 340 |
iso_image = hvp[constants.HV_CDROM_IMAGE_PATH] |
Also available in: Unified diff