yunguol(a)cn.ibm.com wrote:
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1231997388 28800
# Node ID 32645e444b323b137d0c0a2a323be574b370d75a
# Parent 74392c40130a7aa3f6b8c4dfffa0d357b232479b
[TEST] #3 Fix none value for disk assigned for Xen and align parameters in function call
Updates from 2 to 3:
Change comments place
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r 74392c40130a -r 32645e444b32 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 Wed Jan 14 21:29:48 2009 -0800
@@ -249,21 +249,28 @@
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)
-
+
+ #LXC guests do not need to set the EmulationType
+ if virt == 'LXC':
+ d = class_dasd(disk_dev,
+ disk_source,
+ dom_name)
If we are able to fit a function call within 80 columns we don't need to
write each arguments in separate lines.
+ 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 +285,13 @@
net_mac = const.XenFV_default_mac
elif virt == 'LXC':
net_mac = const.LXC_default_mac
Since you comment above saying that LXC does not support network yet, it
would be good to remove
elif virt == 'LXC':
net_mac = const.LXC_default_mac
part as of now and add it when it is needed. I leave it upto you.
Otherwise +1 for me.
- 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()]
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com