Revision 2864f2d9 lib/hypervisor/hv_xen.py

b/lib/hypervisor/hv_xen.py
249 249
      constants.FD_BLKTAP: "tap:aio",
250 250
      }
251 251
    disk_data = []
252
    for cfdev, rldev in block_devices:
252
    if len(block_devices) > 24:
253
      # 'z' - 'a' = 24
254
      raise errors.HypervisorError("Too many disks")
255
    # FIXME: instead of this hardcoding here, each of PVM/HVM should
256
    # directly export their info (currently HVM will just sed this info)
257
    namespace = ["sd" + chr(i + ord('a')) for i in range(24)]
258
    for sd_name, (cfdev, rldev) in zip(namespace, block_devices):
253 259
      if cfdev.dev_type == constants.LD_FILE:
254 260
        line = "'%s:%s,%s,w'" % (FILE_DRIVER_MAP[cfdev.physical_id[0]],
255
                                 rldev.dev_path, cfdev.iv_name)
261
                                 rldev.dev_path, sd_name)
256 262
      else:
257
        line = "'phy:%s,%s,w'" % (rldev.dev_path, cfdev.iv_name)
263
        line = "'phy:%s,%s,w'" % (rldev.dev_path, sd_name)
258 264
      disk_data.append(line)
259 265

  
260 266
    return disk_data

Also available in: Unified diff