Commit 2864f2d9 authored by Iustin Pop's avatar Iustin Pop
Browse files

Change Xen hypervisor to not use iv_name

Currently the iv_name is very linux-specific, and will break with the
multi-disk changes.

The patch changes this to generate sdX names based on the disk index in
the disks structure, instead of relying on the iv_name.

Reviewed-by: imsnah
parent 9a525d83
......@@ -249,12 +249,18 @@ class XenHypervisor(hv_base.BaseHypervisor):
constants.FD_BLKTAP: "tap:aio",
}
disk_data = []
for cfdev, rldev in block_devices:
if len(block_devices) > 24:
# 'z' - 'a' = 24
raise errors.HypervisorError("Too many disks")
# FIXME: instead of this hardcoding here, each of PVM/HVM should
# directly export their info (currently HVM will just sed this info)
namespace = ["sd" + chr(i + ord('a')) for i in range(24)]
for sd_name, (cfdev, rldev) in zip(namespace, block_devices):
if cfdev.dev_type == constants.LD_FILE:
line = "'%s:%s,%s,w'" % (FILE_DRIVER_MAP[cfdev.physical_id[0]],
rldev.dev_path, cfdev.iv_name)
rldev.dev_path, sd_name)
else:
line = "'phy:%s,%s,w'" % (rldev.dev_path, cfdev.iv_name)
line = "'phy:%s,%s,w'" % (rldev.dev_path, sd_name)
disk_data.append(line)
return disk_data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment