On 31/08/12 10:59, Tang Chen wrote:
Hi Chris,
Referred to your comments for net_create tests, I think we can
do the job like following.
1. Construct the class inherit tree like the following.
LibvirtXML(XMLTreeFile)
|
|------VMXML(LibvirtXML)
| |
| |------VMInterfaceXML(VMXML)
| |------VMDiskXML(VMXML)
| |------VMControllerXML(VMXML)
| |------......
|
|------NetworkXML(LibvirtXML)
|
|------StorageXML(LibvirtXML)
|
|------......
Good tree, simple config of Libvirt XML in these classes is more clear.
If we need, we can use these class in tests or other modules directly.
2. Make VMXML object as a member of class VM in libvirt_vm.py.
1) Remove all xml related function in class VM.
2) Initialize VMXML object with dumpxml command when VM object
is initialized.
Well, since class VM should include all vm's operations,
xml operation can be a member of it.
If we separate VMXML with VM class, when we need both them, duplicate
parse of dumpxml will happen.
3) Modify all functions like vm.attach-interface() to update
VMXML object when they modifise the vm's configuration.
How do you think about this?
I will raise an issue on github for this topic.
--
Best Regards
Yu Mingfei
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel