# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1231902765 28800
# Node ID ff2f8adc42d8c41f1af67b0b23e05f9396132a72
# Parent 74392c40130a7aa3f6b8c4dfffa0d357b232479b
[TEST] #2 Fix none value for disk assigned for Xen and align parameters in function call
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r 74392c40130a -r ff2f8adc42d8 suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Jan 13 13:09:25 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Jan 13 19:12:45 2009 -0800
@@ -245,25 +245,31 @@
virt='Xen'):
vssd = get_vssd_mof(virt, dom_name)
+ # Xen uses the default dev and source values for disk
class_dasd = get_dasd_class(virt)
if virt == 'KVM':
disk_dev = 'hda'
disk_source = const.KVM_disk_path
- d = class_dasd(disk_dev, disk_source, dom_name, emu_type)
elif virt == 'XenFV':
disk_dev = 'hda'
disk_source = const.XenFV_disk_path
- d = class_dasd(disk_dev, disk_source, dom_name, emu_type)
elif virt == 'LXC':
disk_dev = const.LXC_default_mp
disk_source = const.LXC_default_source
- d = class_dasd(disk_dev, disk_source, dom_name)
-
+ if virt == 'LXC':
+ d = class_dasd(disk_dev,
+ disk_source,
+ dom_name)
+ else:
+ d = class_dasd(disk_dev,
+ disk_source,
+ dom_name,
+ emu_type)
+
class_masd = get_masd_class(virt)
- m = class_masd(
- megabytes=mem_mb,
- mallocunits=malloc_units,
- name=dom_name)
+ m = class_masd(megabytes=mem_mb,
+ mallocunits=malloc_units,
+ name=dom_name)
# LXC only takes disk and memory device for now.
if virt == 'LXC':
@@ -278,15 +284,13 @@
net_mac = const.XenFV_default_mac
elif virt == 'LXC':
net_mac = const.LXC_default_mac
- n = class_nasd(
- type=net_type,
- mac=net_mac,
- name=dom_name,
- virt_net=net_name)
+ n = class_nasd(type=net_type,
+ mac=net_mac,
+ name=dom_name,
+ virt_net=net_name)
class_pasd = get_pasd_class(virt)
- p = class_pasd(
- vcpu=proc_vcpu,
- name=dom_name)
+ p = class_pasd(vcpu=proc_vcpu,
+ name=dom_name)
return vssd, [d.mof(), n.mof(), p.mof(), m.mof()]