[Libvirt-cim] [PATCH 1 of 3] [TEST] SystemDevice.01_forward XenFV & KVM support

Dan Smith danms at us.ibm.com
Mon Mar 31 16:25:50 UTC 2008


ZL> +    cxml = vxml.get_class(options.virt)(test_dom, vcpus = test_cpu,
ZL> +                                        mac = test_mac, disk = test_disk)

I'm not familiar with the "function(foo)(bar)" syntax.  Can you
explain?

ZL> +    cxml.destroy(options.ip)
ZL> +    ret = cxml.create(options.ip)

Why destroy it immediately and then create?  Does vxml.get_class()()
create the domain, or are you trying to make sure it doesn't already
exist?

ZL> +    devlist = [get_typed_class(options.virt, "NetworkPort"), 
ZL> +               get_typed_class(options.virt, "Memory"),
ZL> +               get_typed_class(options.virt, "LogicalDisk"),
ZL> +               get_typed_class(options.virt, "Processor")]

Is this used anywhere else but below?

ZL> -            if items == "Xen_NetworkPort":
ZL> +            if items == devlist[0]:
ZL>                  _devid = "%s/%s" % (test_dom, test_mac)
ZL> -            elif items == "Xen_LogicalDisk":
ZL> +            elif items == devlist[1]:
ZL> +                _devid = "%s/mem" % test_dom
ZL> +            elif items == devlist[2]:
ZL>                  _devid = "%s/%s" % (test_dom, test_disk)
ZL> -            elif items == "Xen_Processor":
ZL> +            elif items == devlist[3]:
ZL>                  _devid = "%s/%d" % (test_dom, test_cpu-1)
ZL> -            elif items == "Xen_Memory":
ZL> -                _devid = "%s/mem" % test_dom

Going from class names to array values makes this harder to
eye-parse.
                 
-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080331/3cd67f63/attachment.sig>


More information about the Libvirt-cim mailing list