Revision 1213604d
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
236 | 236 |
|
237 | 237 |
boot_disk = (instance.hvparams[constants.HV_BOOT_ORDER] == "disk") |
238 | 238 |
boot_cdrom = (instance.hvparams[constants.HV_BOOT_ORDER] == "cdrom") |
239 |
|
|
240 |
disk_type = instance.hvparams[constants.HV_DISK_TYPE] |
|
241 |
if disk_type == constants.HT_DISK_PARAVIRTUAL: |
|
242 |
if_val = ',if=virtio' |
|
243 |
else: |
|
244 |
if_val = ',if=%s' % disk_type |
|
239 | 245 |
for cfdev, dev_path in block_devices: |
240 | 246 |
if cfdev.mode != constants.DISK_RDWR: |
241 | 247 |
raise errors.HypervisorError("Instance has read-only disks which" |
... | ... | |
248 | 254 |
else: |
249 | 255 |
boot_val = '' |
250 | 256 |
|
251 |
# TODO: handle different if= types |
|
252 |
if_val = ',if=virtio' |
|
253 |
|
|
254 | 257 |
drive_val = 'file=%s,format=raw%s%s' % (dev_path, if_val, boot_val) |
255 | 258 |
kvm_cmd.extend(['-drive', drive_val]) |
256 | 259 |
|
Also available in: Unified diff