[PATCH 0 of 2] #2 Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed.

1) Initalised the MemRASD AllocationUnits and added default values to MemRASD properties. 2) Modified the tc to Pass appropriate values to AllocationUnits field.

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1217937480 25200 # Node ID e58d58ab857cac9cad118eb517294ee1f4ece949 # Parent 60a06040f18db61947039512028c75faf450ceb5 [TEST] #2 Adding AllocationUnits field to MemRASD and updating the call to MemRASD in the libraries where it is accessed. Changes -------- Patch 2: -------- 1) Added default values to MemRASD properties. Patch 1: -------- 1) Initalised the MemRASD AllocationUnits. These changes are required to accomdate the recent RASD provider changes. The changes are tested with KVM, Xen, XenFV on the current sources. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r 60a06040f18d -r e58d58ab857c suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Jul 31 22:37:11 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Aug 05 04:58:00 2008 -0700 @@ -49,6 +49,7 @@ default_domname = 'domU1' default_domname = 'domU1' default_memory = 128 default_vcpus = 1 +default_mallocunits="MegaBytes" _image_dir = '/tmp' diff -r 60a06040f18d -r e58d58ab857c suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Jul 31 22:37:11 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Aug 05 04:58:00 2008 -0700 @@ -203,11 +203,14 @@ def get_pasd_class(virt): pass class CIM_MemResourceAllocationSettingData(CIMClassMOF): - def __init__(self, megabytes, name): + def __init__(self, name, megabytes=512, mallocunits="MegaBytes"): self.ResourceType = RASD_TYPE_MEM if megabytes != None: self.VirtualQuantity = megabytes + + if mallocunits != None: + self.AllocationUnits = mallocunits if name != None: self.InstanceID = '%s/mem' % name @@ -232,6 +235,7 @@ def default_vssd_rasd_str(dom_name='test net_mac=const.Xen_default_mac, proc_vcpu=1, mem_mb=512, + malloc_units="MegaBytes", virt='Xen'): class_vssd = get_vssd_class(virt) vssd = class_vssd(name=dom_name, virt=virt) @@ -258,6 +262,7 @@ def default_vssd_rasd_str(dom_name='test class_masd = get_masd_class(virt) m = class_masd( megabytes=mem_mb, + mallocunits=malloc_units, name=dom_name) if virt == 'LXC': return vssd.mof(), [d.mof(), m.mof()] diff -r 60a06040f18d -r e58d58ab857c suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Jul 31 22:37:11 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 05 04:58:00 2008 -0700 @@ -498,7 +498,7 @@ class VirtXML(Virsh, XMLClass): class VirtCIM: def __init__(self, virt, dom_name, disk_dev, disk_source, - net_type, net_mac, vcpus, mem): + net_type, net_mac, vcpus, mem, mem_allocunits): self.virt = virt self.domain_name = dom_name self.vssd = vsms.get_vssd_class(virt)(name=dom_name, virt=virt) @@ -509,7 +509,9 @@ class VirtCIM: mac=net_mac, name=dom_name) self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name) - self.masd = vsms.get_masd_class(virt)(megabytes=mem, name=dom_name) + self.masd = vsms.get_masd_class(virt)(megabytes=mem, + mallocunits=mem_allocunits, + name=dom_name) def cim_define(self, ip): service = vsms.get_vsms_class(self.virt)(ip) @@ -552,6 +554,7 @@ class XenXML(VirtXML, VirtCIM): def __init__(self, test_dom=const.default_domname, mem=const.default_memory, + mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, mac=const.Xen_default_mac, disk_file_path=const.Xen_disk_path, @@ -567,7 +570,7 @@ class XenXML(VirtXML, VirtCIM): self._devices(disk_file_path, disk, ntype, mac) VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, - ntype, mac, vcpus, mem) + ntype, mac, vcpus, mem, mem_allocunits) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os')

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1217937888 25200 # Node ID c5f346ab79d7abab5e4b9d433cc89108d4265870 # Parent e58d58ab857cac9cad118eb517294ee1f4ece949 [TEST] #2 Fixing the tc 08_modifyresource.py and updating the others to accomdate the AllocationUnits field changes. Changes: ------- Patch 2: -------- 1) Reverted the changes to 08_modifyresource.py, since it is no longer required and the default values are assigned in the library for MemRASD. Hence the 08_modifyresource.py is no longer in the patch. Patch 1: -------- 1) Modified the tc to Pass appropriate values to AllocationUnits field. The changes are tested with KVM, Xen, XenFV on the current sources. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r e58d58ab857c -r c5f346ab79d7 suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py --- a/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Tue Aug 05 04:58:00 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Tue Aug 05 05:04:48 2008 -0700 @@ -78,7 +78,7 @@ def test_rasd(options, temp, test_size): drasd = drasd_class("hda", temp, default_dom) mrasd_class = vsms.get_masd_class(options.virt) - mrasd = mrasd_class(32, default_dom) + mrasd = mrasd_class(name=default_dom, megabytes=32) params = { "vssd" : vssd.mof(), diff -r e58d58ab857c -r c5f346ab79d7 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Tue Aug 05 04:58:00 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Tue Aug 05 05:04:48 2008 -0700 @@ -47,10 +47,8 @@ values = [ def try_define(options, vssd, units, value): mrasd_class = vsms.get_masd_class(options.virt) - mrasd = mrasd_class(None, default_dom) - - mrasd.AllocationUnits = units - mrasd.VirtualQuantity = value + mrasd = mrasd_class(megabytes=value, mallocunits=units, + name=default_dom) params = { "vssd" : vssd.mof(),
participants (1)
-
Deepti B. Kalakeri