]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-xml-validate: add missing schemas
authorEric Blake <eblake@redhat.com>
Mon, 19 Aug 2013 22:32:31 +0000 (16:32 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 20 Aug 2013 02:25:49 +0000 (20:25 -0600)
We were failing to autoprobe which schema to use for several
top-level XML elements.

* tools/virt-xml-validate.in (TYPE): Recognize <domainsnapshot>,
<filter>, and <secret>.

Signed-off-by: Eric Blake <eblake@redhat.com>
tools/virt-xml-validate.in

index 5ba034331e9d1473810af9e54cbd6dfb8b5fe98e..6bfa68fe0e35641cd17c348b5d5fe4123158399e 100644 (file)
@@ -56,6 +56,9 @@ fi
 if [ -z "$TYPE" ]; then
   ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk '{ print $3 }'`
   case "$ROOT" in
+     *domainsnapshot*) # Must come first, since *domain* is a substring
+        TYPE="domainsnapshot"
+        ;;
      *domain*)
         TYPE="domain"
         ;;
@@ -74,6 +77,12 @@ if [ -z "$TYPE" ]; then
      *device*)
         TYPE="nodedev"
         ;;
+     *filter*)
+        TYPE="nwfilter"
+        ;;
+     *secret*)
+        TYPE="secret"
+        ;;
      *)
        echo "$0: cannot determine schema type for $XMLFILE" >&2
        exit 3