[Libvirt-cim] [PATCH 2 of 3] [TEST] Fix VSSD mof generation
Deepti B Kalakeri
deeptik at linux.vnet.ibm.com
Fri Oct 17 12:07:04 UTC 2008
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1224123190 25200
> # Node ID 31fca7629bd7f394c3a900c9f20c5573bcedc1f7
> # Parent bbd83da2f0f6bc96ec47025dda3f4f42c095ab86
> [TEST] Fix VSSD mof generation
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r bbd83da2f0f6 -r 31fca7629bd7 suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py
> --- a/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Wed Oct 08 18:18:48 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/RASD/04_disk_rasd_size.py Wed Oct 15 19:13:10 2008 -0700
> @@ -71,8 +71,7 @@
> return PASS
>
> def test_rasd(options, temp, test_size):
> - vssd_class = vsms.get_vssd_class(options.virt)
> - vssd = vssd_class(name=default_dom, virt=options.virt)
> + vssd = vsms.get_vssd_mof(options.virt, default_dom)
>
> drasd_class = vsms.get_dasd_class(options.virt)
> drasd = drasd_class("hda", temp, default_dom)
> @@ -81,7 +80,7 @@
> mrasd = mrasd_class(name=default_dom, megabytes=32)
>
> params = {
> - "vssd" : vssd.mof(),
> + "vssd" : vssd,
> "rasd" : [drasd.mof(), mrasd.mof()]
> }
>
> diff -r bbd83da2f0f6 -r 31fca7629bd7 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py
> --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Wed Oct 08 18:18:48 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Wed Oct 15 19:13:10 2008 -0700
> @@ -51,7 +51,7 @@
> name=default_dom)
>
> params = {
> - "vssd" : vssd.mof(),
> + "vssd" : vssd,
> "rasd" : [mrasd.mof()],
> }
>
> @@ -101,8 +101,7 @@
> def main():
> options = main.options
>
> - vssd_class = vsms.get_vssd_class(options.virt)
> - vssd = vssd_class(name=default_dom, virt=options.virt)
> + vssd = vsms.get_vssd_mof(options.virt, default_dom)
>
> status = PASS
>
> diff -r bbd83da2f0f6 -r 31fca7629bd7 suites/libvirt-cim/lib/XenKvmLib/vsms.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Oct 08 18:18:48 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Oct 15 19:13:10 2008 -0700
> @@ -108,7 +108,6 @@
> self.Kernel = const.Xen_kernel_path
> self.Ramdisk = const.Xen_init_path
>
> -
> class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData):
> pass
>
> @@ -118,9 +117,10 @@
> class LXC_VirtualSystemSettingData(CIM_VirtualSystemSettingData):
> pass
>
> - at eval_cls('VirtualSystemSettingData')
> -def get_vssd_class(virt):
> - pass
> +def get_vssd_mof(virt, dom_name):
> + vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData"))
> + vssd = vssd_cn(dom_name, virt)
>
I did not get the difference between vssd_cn and vssd assignments, both
of them evaluate to classobj XenKvmLib.vsms.Xen_VirtualSystemSettingData.
> + return vssd.mof()
>
> # classes to define RASD parameters
> class CIM_DiskResourceAllocationSettingData(CIMClassMOF):
> @@ -238,8 +238,7 @@
> mem_mb=512,
> malloc_units="MegaBytes",
> virt='Xen'):
> - class_vssd = get_vssd_class(virt)
> - vssd = class_vssd(name=dom_name, virt=virt)
> + vssd = get_vssd_mof(virt, dom_name)
>
> class_dasd = get_dasd_class(virt)
> if virt == 'KVM':
> @@ -261,7 +260,7 @@
>
> # LXC only takes disk and memory device for now.
> if virt == 'LXC':
> - return vssd.mof(), [d.mof(), m.mof()]
> + return vssd, [d.mof(), m.mof()]
>
> class_nasd = get_nasd_class(virt)
> if net_mac != const.Xen_default_mac:
> @@ -282,5 +281,5 @@
> vcpu=proc_vcpu,
> name=dom_name)
>
> - return vssd.mof(), [d.mof(), n.mof(), p.mof(), m.mof()]
> + return vssd, [d.mof(), n.mof(), p.mof(), m.mof()]
>
> diff -r bbd83da2f0f6 -r 31fca7629bd7 suites/libvirt-cim/lib/XenKvmLib/vxml.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Oct 08 18:18:48 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Oct 15 19:13:10 2008 -0700
> @@ -466,7 +466,7 @@
> net_type, net_name, 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)
> + self.vssd = vsms.get_vssd_mof(virt, dom_name)
> self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, dom_name)
> self.nasd = vsms.get_nasd_class(virt)(type=net_type,
> mac=net_mac,
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
More information about the Libvirt-cim
mailing list