mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-03 12:55:45 +00:00
virt-xml-validate: Add more XML formats support
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>
This commit is contained in:
parent
af1933713b
commit
7b0e2e4a55
@ -31,18 +31,42 @@ from the name of the root element in the XML document.
|
|||||||
|
|
||||||
Valid schema names currently include
|
Valid schema names currently include
|
||||||
|
|
||||||
|
- ``cpu``
|
||||||
|
|
||||||
|
The schema for the XML format of cpu
|
||||||
|
|
||||||
- ``domainsnapshot``
|
- ``domainsnapshot``
|
||||||
|
|
||||||
The schema for the XML format used by domain snapshot configuration
|
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``
|
- ``domain``
|
||||||
|
|
||||||
The schema for the XML format used by guest domains configuration
|
The schema for the XML format used by guest domains configuration
|
||||||
|
|
||||||
|
- ``networkport``
|
||||||
|
|
||||||
|
The schema for the XML format used by network port configuration
|
||||||
|
|
||||||
- ``network``
|
- ``network``
|
||||||
|
|
||||||
The schema for the XML format used by virtual network configuration
|
The schema for the XML format used by virtual network configuration
|
||||||
|
|
||||||
|
- ``storagepoolcaps``
|
||||||
|
|
||||||
|
The schema for the XML format of storage pool capabilities
|
||||||
|
|
||||||
- ``storagepool``
|
- ``storagepool``
|
||||||
|
|
||||||
The schema for the XML format used by storage pool configuration
|
The schema for the XML format used by storage pool configuration
|
||||||
|
@ -74,9 +74,21 @@ if [ -z "$TYPE" ]; then
|
|||||||
ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk '{ print $3 }'`
|
ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk '{ print $3 }'`
|
||||||
fi
|
fi
|
||||||
case "$ROOT" in
|
case "$ROOT" in
|
||||||
|
*cpu*)
|
||||||
|
TYPE="cpu"
|
||||||
|
;;
|
||||||
*domainsnapshot*) # Must come first, since *domain* is a substring
|
*domainsnapshot*) # Must come first, since *domain* is a substring
|
||||||
TYPE="domainsnapshot"
|
TYPE="domainsnapshot"
|
||||||
;;
|
;;
|
||||||
|
*domaincheckpoint*)
|
||||||
|
TYPE="domaincheckpoint"
|
||||||
|
;;
|
||||||
|
*domainbackup*)
|
||||||
|
TYPE="domainbackup"
|
||||||
|
;;
|
||||||
|
*domaincaps*)
|
||||||
|
TYPE="domaincaps"
|
||||||
|
;;
|
||||||
*domain*)
|
*domain*)
|
||||||
TYPE="domain"
|
TYPE="domain"
|
||||||
;;
|
;;
|
||||||
@ -86,6 +98,9 @@ if [ -z "$TYPE" ]; then
|
|||||||
*network*)
|
*network*)
|
||||||
TYPE="network"
|
TYPE="network"
|
||||||
;;
|
;;
|
||||||
|
*storagepoolcaps*)
|
||||||
|
TYPE="storagepoolcaps"
|
||||||
|
;;
|
||||||
*pool*)
|
*pool*)
|
||||||
TYPE="storagepool"
|
TYPE="storagepool"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user