δΊ 2012-2-23 16:27, Alex Jia ει: > On 02/23/2012 11:48 AM, Yu Mingfei wrote: >> This patch adds a virsh_define() function to libvirt_vm. >> >> Signed-off-by: yumingfei<[email protected]> >> --- >> client/virt/libvirt_vm.py | 12 ++++++++++++ >> 1 files changed, 12 insertions(+), 0 deletions(-) >> >> diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py >> index 4b391c1..e38fcb8 100644 >> --- a/client/virt/libvirt_vm.py >> +++ b/client/virt/libvirt_vm.py >> @@ -305,6 +305,18 @@ def virsh_destroy(name, uri = ""): >> logging.error("Destroy VM %s failed:\n%s", name, detail) >> return False >> >> +def virsh_define(xml_path, uri = ""): >> + """ >> + Return True on successful domain define. >> + >> + @param xml_path: XML file path >> + """ >> + try: >> + virsh_cmd("define --file %s" % xml_path, uri) >> + return True >> + except error.CmdError: >> + logging.error("Define %s failed.", xml_path) >> + return False >> >> def virsh_undefine(name, uri = ""): >> """ > The same issue to "Add attach-device() and detach-device() functions to > libvirt_vm.", the codes > hasn't done any actually check on libvirt side.
Ok, I understand. The work of unit test for define/undefine is underway, so maybe nextweek we will send APIs and test cases out. Regards, Yu Mingfei > > Regards, > Alex > > -- Best Regards Yu Mingfei -------------------------------------------------- Development Dept.I Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST) No. 6 Wenzhu Road, Nanjing, 210012, China PHONE: +86-25-86630566-8529 COINS: 8529 MAIL: [email protected] ------------------------------------------------- _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
