Revision 117a85a0 lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
1137 | 1137 |
cache_val = ",cache=%s" % disk_cache |
1138 | 1138 |
else: |
1139 | 1139 |
cache_val = "" |
1140 |
for cfdev, dev_path in block_devices: |
|
1140 |
for cfdev, dev_path, device in block_devices:
|
|
1141 | 1141 |
if cfdev.mode != constants.DISK_RDWR: |
1142 | 1142 |
raise errors.HypervisorError("Instance has read-only disks which" |
1143 | 1143 |
" are not supported by KVM") |
... | ... | |
1149 | 1149 |
if needs_boot_flag and disk_type != constants.HT_DISK_IDE: |
1150 | 1150 |
boot_val = ",boot=on" |
1151 | 1151 |
|
1152 |
drive_val = "file=%s,format=raw%s%s%s" % (dev_path, if_val, boot_val, |
|
1153 |
cache_val) |
|
1152 |
if cfdev.params[constants.LDP_ACCESS] == constants.DISK_USERSPACE: |
|
1153 |
drive_uri = device.GetUserspaceAccessUri(constants.HT_KVM) |
|
1154 |
else: |
|
1155 |
drive_uri = dev_path |
|
1156 |
|
|
1157 |
drive_val = "file=%s,format=raw%s%s%s" % (drive_uri, if_val, |
|
1158 |
boot_val, cache_val) |
|
1154 | 1159 |
kvm_cmd.extend(["-drive", drive_val]) |
1155 | 1160 |
|
1156 | 1161 |
#Now we can specify a different device type for CDROM devices. |
Also available in: Unified diff