Revision d34b16d7

b/lib/hypervisor/hv_kvm.py
222 222

  
223 223
    boot_drive = True
224 224
    for cfdev, dev_path in block_devices:
225
      if cfdev.mode != constants.DISK_RDWR:
226
        raise errors.HypervisorError("Instance has read-only disks which"
227
                                     " are not supported by KVM")
225 228
      # TODO: handle FD_LOOP and FD_BLKTAP (?)
226 229
      if boot_drive:
227 230
        boot_val = ',boot=on'
b/lib/hypervisor/hv_xen.py
277 277
    # directly export their info (currently HVM will just sed this info)
278 278
    namespace = ["sd" + chr(i + ord('a')) for i in range(24)]
279 279
    for sd_name, (cfdev, dev_path) in zip(namespace, block_devices):
280
      if cfdev.mode == constants.DISK_RDWR:
281
        mode = "w"
282
      else:
283
        mode = "r"
280 284
      if cfdev.dev_type == constants.LD_FILE:
281
        line = "'%s:%s,%s,w'" % (FILE_DRIVER_MAP[cfdev.physical_id[0]],
282
                                 dev_path, sd_name)
285
        line = "'%s:%s,%s,%s'" % (FILE_DRIVER_MAP[cfdev.physical_id[0]],
286
                                  dev_path, sd_name, mode)
283 287
      else:
284
        line = "'phy:%s,%s,w'" % (dev_path, sd_name)
288
        line = "'phy:%s,%s,%s'" % (dev_path, sd_name, mode)
285 289
      disk_data.append(line)
286 290

  
287 291
    return disk_data

Also available in: Unified diff