On 02/28/2013 03:05 AM, Yu Mingfei wrote:
+    def is_dumpxml_of_running_vm(dumpxml, domid):
+        """
+        To check whether the dumpxml is got during vm is running.
+
+        @param dumpxml: the output of virsh dumpxml.
+        @param domid: the id of vm
+        """
+        match_string = "<domain.*id='%s'/>" % domid
+        if re.search(dumpxml, match_string):
+            return True
+        return False

This is a perfect place to use /usr/bin/virt-xml-validate XMLFILE (part of libvirt-client package). It will return 0 if the XML is correct and non-zero if not. Maybe this should be a libvirt_xml function?

--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to