[PATCH] [TEST] Fix none value for disk assigned for Xen

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1231816020 28800 # Node ID 1ac5b107e0f047c30d6a0044735b09e3fe144100 # Parent 43bf01b82ce9f627af1b5db55922b0584cd0e3b4 [TEST] Fix none value for disk assigned for Xen Signed-off-by: Guolian Yun<yunguol@cn.ibm.com> diff -r 43bf01b82ce9 -r 1ac5b107e0f0 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jan 12 08:22:47 2009 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jan 12 19:07:00 2009 -0800 @@ -249,16 +249,18 @@ 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 + + if virt == 'LXC': d = class_dasd(disk_dev, disk_source, dom_name) - + else: + # Xen's case falls in here using the default values + d = class_dasd(disk_dev, disk_source, dom_name, emu_type) class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb,

yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1231816020 28800 # Node ID 1ac5b107e0f047c30d6a0044735b09e3fe144100 # Parent 43bf01b82ce9f627af1b5db55922b0584cd0e3b4 [TEST] Fix none value for disk assigned for Xen
Signed-off-by: Guolian Yun<yunguol@cn.ibm.com>
diff -r 43bf01b82ce9 -r 1ac5b107e0f0 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jan 12 08:22:47 2009 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jan 12 19:07:00 2009 -0800 @@ -249,16 +249,18 @@ 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 + + if virt == 'LXC': d = class_dasd(disk_dev, disk_source, dom_name) - + else: + # Xen's case falls in here using the default values + d = class_dasd(disk_dev, disk_source, dom_name, emu_type)
+1 , but make sure next time we align the comments with the block properly.
class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb,
The above function call should be aligned as follows. m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik@linux.vnet.ibm.com

+ + if virt == 'LXC': d = class_dasd(disk_dev, disk_source, dom_name) - + else: + # Xen's case falls in here using the default values + d = class_dasd(disk_dev, disk_source, dom_name, emu_type) +1 , but make sure next time we align the comments with the block properly. class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb,
The above function call should be aligned as follows. m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
I agree with these comments. Daisy - can you resend the patch with these updates? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

+ + if virt == 'LXC': d = class_dasd(disk_dev, disk_source, dom_name) - + else: + # Xen's case falls in here using the default values + d = class_dasd(disk_dev, disk_source, dom_name, emu_type) +1 , but make sure next time we align the comments with the block
libvirt-cim-bounces@redhat.com wrote on 2009-01-14 04:35:35: properly.
class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb,
The above function call should be aligned as follows. m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
I agree with these comments. Daisy - can you resend the patch with these updates?
I think it's better to align them as follows: m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name) Also, the other functions such as network and processor call have to be updated. I resend a new patch to fix them. Thanks!
Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Guo Lian Yun wrote:
libvirt-cim-bounces@redhat.com wrote on 2009-01-14 04:35:35:
+ + if virt == 'LXC': d = class_dasd(disk_dev, disk_source, dom_name) - + else: + # Xen's case falls in here using the default values + d = class_dasd(disk_dev, disk_source, dom_name, emu_type) +1 , but make sure next time we align the comments with the block properly. class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb,
The above function call should be aligned as follows. m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
I agree with these comments. Daisy - can you resend the patch with these updates?
I think it's better to align them as follows: m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
Also, the other functions such as network and processor call have to be updated. I resend a new patch to fix them.
Thanks!
Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
------------------------------------------------------------------------
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
I usually follow this style m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name) (i.e. aligning the function parameters, like in C). But, to be honest, there isn't a written convention on that and I didn't find any existing case on the code, so we can follow the style. -- Richard Maciel, MSc IBM Linux Technology Center rmaciel@linux.vnet.ibm.com

I agree with these comments. Daisy - can you resend the patch with these updates?
I think it's better to align them as follows: m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name) Also, the other functions such as network and processor call have to be updated. I resend a new patch to fix them.
Thanks!
I usually follow this style
m = class_masd(megabytes=mem_mb, mallocunits=malloc_units, name=dom_name)
(i.e. aligning the function parameters, like in C). But, to be honest, there isn't a written convention on that and I didn't find any existing case on the code, so we can follow the style.
See Dan's comment - the spacing is slightly off in this alignment. Daisy has the alignment fixed in the second revision of her patch. There isn't a coding style document for cimtest yet. However, I can work on putting on together since it is a good thing to have. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

GY> I think it's better to align them as follows: GY> m = class_masd(megabytes=mem_mb, GY> mallocunits=malloc_units, GY> name=dom_name) You need an extra space in the subsequent lines. The first character of the parameter names should align with each other. Currently, the first character of "mallocunits" (for example) aligns with the open paren, which is not correct. -- Dan Smith IBM Linux Technology Center email: danms@us.ibm.com
participants (6)
-
Dan Smith
-
Deepti B Kalakeri
-
Guo Lian Yun
-
Kaitlin Rupert
-
Richard Maciel
-
yunguol@cn.ibm.com