]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-xml-validate: Add more XML formats support
authorHan Han <hhan@redhat.com>
Wed, 11 May 2022 06:18:32 +0000 (14:18 +0800)
committerJán Tomko <jtomko@redhat.com>
Fri, 13 May 2022 15:15:24 +0000 (17:15 +0200)
Add these XML formats validation in manpage or script:
cpu, domainbackup, domaincaps, domaincheckpoint, networkport,
storagepoolcaps.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
docs/manpages/virt-xml-validate.rst
tools/virt-xml-validate.in

index 940eada3a81b49d4d00bd6dd3d0aa182c1293e82..503ddbd35a6b32fd91bd7fdfea7a6f4858dfe15b 100644 (file)
@@ -31,18 +31,42 @@ from the name of the root element in the XML document.
 
 Valid schema names currently include
 
+- ``cpu``
+
+The schema for the XML format of cpu
+
 - ``domainsnapshot``
 
 The schema for the XML format used by domain snapshot configuration
 
+- ``domaincheckpoint``
+
+The schema for the XML format used by domain checkpoint configuration
+
+- ``domainbackup``
+
+The schema for the XML format used by domain backup configuration
+
+- ``domaincaps``
+
+The schema for the XML format of domain capabilities
+
 - ``domain``
 
 The schema for the XML format used by guest domains configuration
 
+- ``networkport``
+
+The schema for the XML format used by network port configuration
+
 - ``network``
 
 The schema for the XML format used by virtual network configuration
 
+- ``storagepoolcaps``
+
+The schema for the XML format of storage pool capabilities
+
 - ``storagepool``
 
 The schema for the XML format used by storage pool configuration
index 249bcf7eef26b4bd6db85b967ac8331834cb76ca..e444ef2fbce5f1f6be819f75cbb523adb6f8a2e7 100644 (file)
@@ -74,9 +74,21 @@ if [ -z "$TYPE" ]; then
     ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk '{ print $3 }'`
   fi
   case "$ROOT" in
+     *cpu*)
+        TYPE="cpu"
+        ;;
      *domainsnapshot*) # Must come first, since *domain* is a substring
         TYPE="domainsnapshot"
         ;;
+     *domaincheckpoint*)
+        TYPE="domaincheckpoint"
+        ;;
+     *domainbackup*)
+        TYPE="domainbackup"
+        ;;
+     *domaincaps*)
+        TYPE="domaincaps"
+        ;;
      *domain*)
         TYPE="domain"
         ;;
@@ -86,6 +98,9 @@ if [ -z "$TYPE" ]; then
      *network*)
         TYPE="network"
         ;;
+     *storagepoolcaps*)
+        TYPE="storagepoolcaps"
+        ;;
      *pool*)
         TYPE="storagepool"
         ;;