
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@us.ibm.com