Hi Chris,Alex: Thanks for your comments. I am sorry about making you mistake "virt-edit" with "virsh edit".
We need to test virt-edit here, and virt-edit modifies a file in a domain's img directly. However, create_new_vm() just renames a vm. Sometimes, we want to test a vm with different names, right or wrong. For example: 12345678, -vm1, #, and so on. (Please refer to patch 3/3 v2) To keep the vm1(main test vm) object safe, we decide to define a new vm object with a new name. All the new-name tests are based on the new vm object, and vm1 will be shutdown before new vm is defined. After the test, the new vm will be undefined. This is why this function is created. This function is also used in many other tests of ours. And according to Cleber's suggestion, I put it into a seperate file libvirt_xml_utils.py. Maybe the create_new_vm() or its name confused your guys. How about the following idea ? Implement a vm.rename() function in libvirt_cm.py, doing the following things: 1. xml_bak = self.backup_xml() 2. self.undefine() 3. change the name in xml_bak into a new one 4. self.define(xml_bak) 5. self.name = new_name 6. remove xml_bak -- Best Regards Yu Mingfei _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
