diff --git a/lib/backend.py b/lib/backend.py index 55aae5ddb1937fd1f4dca2d31504b35c6ac641b4..ed72b29b9ae6638837c75ea076ed064ebf69eacc 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -741,8 +741,8 @@ def _GatherBlockDevs(instance): @type instance: L{objects.Instance} @param instance: the instance whose disks we shoul assemble - @rtype: list of L{bdev.BlockDev} - @return: list of the block devices + @rtype: list + @return: list of (disk_object, device_path) """ block_devices = [] @@ -752,7 +752,7 @@ def _GatherBlockDevs(instance): raise errors.BlockDeviceError("Block device '%s' is not set up." % str(disk)) device.Open() - block_devices.append((disk, device)) + block_devices.append((disk, device.dev_path)) return block_devices diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index f3f5b4ecac1ed5ebf08c4824db1447495610703f..c40b5e3f91fb7b557e39e9d9e3f12c6e235c8630 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -203,7 +203,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): nic_seq += 1 boot_drive = True - for cfdev, rldev in block_devices: + for cfdev, dev_path in block_devices: # TODO: handle FD_LOOP and FD_BLKTAP (?) if boot_drive: boot_val = ',boot=on' @@ -214,7 +214,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): # TODO: handle different if= types if_val = ',if=virtio' - drive_val = 'file=%s,format=raw%s%s' % (rldev.dev_path, if_val, boot_val) + drive_val = 'file=%s,format=raw%s%s' % (dev_path, if_val, boot_val) kvm_cmd.extend(['-drive', drive_val]) kvm_cmd.extend(['-kernel', instance.hvparams[constants.HV_KERNEL_PATH]]) diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py index c4aebf38261a804b7ae11cdb9313c38c504c548e..a0a59ad3496131a6d80ba303004e9a808654f1b3 100644 --- a/lib/hypervisor/hv_xen.py +++ b/lib/hypervisor/hv_xen.py @@ -256,12 +256,12 @@ class XenHypervisor(hv_base.BaseHypervisor): # 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): + for sd_name, (cfdev, dev_path) 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, sd_name) + dev_path, sd_name) else: - line = "'phy:%s,%s,w'" % (rldev.dev_path, sd_name) + line = "'phy:%s,%s,w'" % (dev_path, sd_name) disk_data.append(line) return disk_data