diff options
Diffstat (limited to 'src/main/resources/libvirt/rng')
26 files changed, 16302 insertions, 0 deletions
diff --git a/src/main/resources/libvirt/rng/basictypes.rng b/src/main/resources/libvirt/rng/basictypes.rng new file mode 100644 index 0000000..2931e31 --- /dev/null +++ b/src/main/resources/libvirt/rng/basictypes.rng @@ -0,0 +1,680 @@ +<?xml version="1.0"?> +<!-- network-related definitions used in multiple grammars --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- Our unsignedInt doesn't allow a leading "+" in its lexical form --> + <define name="unsignedInt"> + <data type="unsignedInt"> + <param name="pattern">[0-9]+</param> + </data> + </define> + <define name="unsignedLong"> + <data type="unsignedLong"> + <param name="pattern">[0-9]+</param> + </data> + </define> + + <define name="hexuint"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-f]+</param> + </data> + </define> + + <define name="positiveInteger"> + <data type="positiveInteger"> + <param name="pattern">[0-9]+</param> + </data> + </define> + + <define name="octalMode"> + <data type="unsignedInt"> + <param name="pattern">[0-7]+</param> + </data> + </define> + + <define name="uint8"> + <choice> + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,2}</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">255</param> + </data> + </choice> + </define> + <define name="uint16"> + <choice> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">65535</param> + </data> + </choice> + </define> + <define name="uint24"> + <choice> + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,6}</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">16777215</param> + </data> + </choice> + </define> + <define name="uint32"> + <choice> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,8}</param> + </data> + <data type="unsignedInt"> + <param name="minInclusive">0</param> + <param name="maxInclusive">4294967295</param> + </data> + </choice> + </define> + + <define name="UUID"> + <choice> + <data type="string"> + <param name="pattern">[a-fA-F0-9]{32}</param> + </data> + <data type="string"> + <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param> + </data> + </choice> + </define> + + <define name="numaDistanceValue"> + <data type="unsignedInt"> + <param name="minInclusive">10</param> + <param name="maxInclusive">255</param> + </data> + </define> + + <define name="pciaddress"> + <optional> + <attribute name="domain"> + <ref name="pciDomain"/> + </attribute> + </optional> + <optional> + <attribute name="bus"> + <ref name="pciBus"/> + </attribute> + </optional> + <optional> + <attribute name="slot"> + <ref name="pciSlot"/> + </attribute> + </optional> + <optional> + <attribute name="function"> + <ref name="pciFunc"/> + </attribute> + </optional> + <optional> + <attribute name="multifunction"> + <ref name="virOnOff"/> + </attribute> + </optional> + </define> + <define name="zpciaddress"> + <optional> + <element name="zpci"> + <optional> + <attribute name="uid"> + <ref name="uint16"/> + </attribute> + </optional> + <optional> + <attribute name="fid"> + <ref name="uint32"/> + </attribute> + </optional> + </element> + </optional> + </define> + + <!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" --> + <!-- The lowest bit of the 1st byte is the "multicast" bit. a --> + <!-- uniMacAddr requires that bit to be 0, and a multiMacAddr --> + <!-- requires it to be 1. Plain macAddr will accept either. --> + <!-- Currently there is no use of multiMacAddr in libvirt, it --> + <!-- is included here for documentation/comparison purposes. --> + <define name="uniMacAddr"> + <data type="string"> + <param name="pattern">[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}</param> + </data> + </define> + <define name="multiMacAddr"> + <data type="string"> + <param name="pattern">[a-fA-F0-9][13579bBdDfF](:[a-fA-F0-9]{2}){5}</param> + </data> + </define> + <define name="macAddr"> + <data type="string"> + <param name="pattern">[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5}</param> + </data> + </define> + + <!--====================================================================--> + <!--The duid is a unique identifier used in DHCPv6 to identity an --> + <!--interface on a device (system). The duid is often used by servers --> + <!--such as dnsmasq to assign a specific IP address (and optionally a --> + <!--name to an interface. The applicable standards are RFC3315 and --> + <!--RFC6355. These standards actually require the duid to be fixed for --> + <!--the hardware device and applicable to all network interfaces on --> + <!--that device. It is not clear that any software currently enforces --> + <!--this requirement although it could be implemented manually. --> + <!--====================================================================--> + <!--There are currently four types of duids defined: --> + <!-- type 1, duid-LLT, link-layer (MAC) plus 32 bit time when the --> + <!-- duid-LLT was created in seconds from January 1, 2000 --> + <!-- type 2, duid-EN, 32 bit "enterprise number" followed by a --> + <!-- variable length unique identifier. --> + <!-- type 3, duid-LL, link-layer (MAC) --> + <!-- type 4, duid-UUID, a 128 bit UUID (16 bytes) --> + <!--RFC3315 states that the maximum length of a duid is 128 bytes plus --> + <!--the 16 bit type field. Often, the machine type is "1" which is the --> + <!--number assigned to ethernet. --> + + <define name="duidLLT"> + <data type="string"> + <!-- 0======| type======| 0======| machine type======| time================| link-layer============| --> + <param name="pattern">[0]{1,2}:[0]{0,1}[1]:[0]{1,2}:[0]{0,1}[a-fA-F1-9](:[a-fA-F0-9]{1,2}){4}(:[a-fA-F0-9]{1,2}){6,8}</param> + </data> + </define> + + <define name="duidEN"> + <data type="string"> + <!-- 0======| type======| Enterprise number===| unique id ==============| --> + <param name="pattern">[0]{1,2}:[0]{0,1}[2](:[a-fA-F0-9]{1,2}){4}(:[a-fA-F0-9]{1,2}){1,124}</param> + </data> + </define> + + <define name="duidLL"> + <data type="string"> + <!-- 0======| type======| 0======| machine type======| link-layer============| --> + <param name="pattern">[0]{1,2}:[0]{0,1}[3]:[0]{1,2}:[0]{0,1}[a-fA-F1-9](:[a-fA-F0-9]{1,2}){6,8}</param> + </data> + </define> + + <define name="duidUUID"> + <data type="string"> + <!-- 0======| type======| UUID=================| --> + <param name="pattern">[0]{1,2}:[0]{0,1}[4](:[a-fA-F0-9]{1,2}){16}</param> + </data> + </define> + + <define name="DUID"> + <choice> + <ref name="duidLLT"/> + <ref name="duidEN"/> + <ref name="duidLL"/> + <ref name="duidUUID"/> + </choice> + </define> + <!--======================================================================--> + + <!-- A D-Bus server address: https://dbus.freedesktop.org/doc/dbus-specification.html#addresses --> + <define name="dbusAddr"> + <data type="string"> + <param name="pattern">.+</param> + </data> + </define> + + <!-- An ipv4 "dotted quad" address --> + <define name="ipv4Addr"> + <data type="string"> + <param name="pattern">(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))</param> + </data> + </define> + + <!-- Based on https://web.archive.org/web/20090503193311/http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6 --> + <define name="ipv6Addr"> + <data type="string"> + <!-- To understand this better, take apart the toplevel "|"s --> +<param name="pattern">(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(([0-9A-Fa-f]{1,4}:){0,5}:(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|(::([0-9A-Fa-f]{1,4}:){0,5}(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9])))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(::)</param> + </data> + </define> + + <define name="ipAddr"> + <choice> + <ref name="ipv4Addr"/> + <ref name="ipv6Addr"/> + </choice> + </define> + + <define name="ipv4Prefix"> + <data type="unsignedInt"> + <param name="maxInclusive">32</param> + </data> + </define> + + <define name="ipv6Prefix"> + <data type="unsignedInt"> + <param name="maxInclusive">128</param> + </data> + </define> + + <define name="ipPrefix"> + <choice> + <ref name="ipv4Prefix"/> + <ref name="ipv6Prefix"/> + </choice> + </define> + + <!-- objectName represents any generic string for naming objects like domain --> + <define name="objectNameWithSlash"> + <data type="string"> + <param name="pattern">[^\n]+</param> + </data> + </define> + + <define name="objectName"> + <data type="string"> + <param name="pattern">[^/\n]+</param> + </data> + </define> + + <define name="genericName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\+\-]+</param> + </data> + </define> + + <define name="dnsName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9\.\-]+</param> + </data> + </define> + + <define name="deviceName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.\-\\:/]+</param> + </data> + </define> + + <define name="zoneName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\-]+</param> + </data> + </define> + + <define name="filePath"> + <data type="string"> + <param name="pattern">.+</param> + </data> + </define> + + <define name="dirPath"> + <data type="string"> + <param name="pattern">.+</param> + </data> + </define> + + <define name="absFilePath"> + <data type="string"> + <param name="pattern">(/|[a-zA-Z]:\\).+</param> + </data> + </define> + + <define name="vmwarePath"> + <data type="string"> + <param name="pattern">\[[^\]]+\] .+</param> + </data> + </define> + + <define name="absDirPath"> + <data type="string"> + <param name="pattern">/.*</param> + </data> + </define> + + <define name="unit"> + <data type="string"> + <param name="pattern">([bB]([yY][tT][eE][sS]?)?)|([kKmMgGtTpPeE]([iI]?[bB])?)</param> + </data> + </define> + <define name="scaledInteger"> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + <ref name="unsignedLong"/> + </define> + + <define name="pciDomain"> + <ref name="uint32"/> + </define> + <define name="pciBus"> + <ref name="uint8"/> + </define> + <define name="pciSlot"> + <choice> + <data type="string"> + <param name="pattern">(0x)?[0-1]?[0-9a-fA-F]</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">31</param> + </data> + </choice> + </define> + <define name="pciFunc"> + <choice> + <data type="string"> + <param name="pattern">(0x)?[0-7]</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">7</param> + </data> + </choice> + </define> + + <define name="wwn"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{16}</param> + </data> + </define> + + <define name="ccwCssidRange"> + <choice> + <data type="string"> + <param name="pattern">0x[0-9a-eA-E][0-9a-fA-F]?</param> + </data> + <data type="string"> + <param name="pattern">0x[fF][0-9a-eA-E]?</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">254</param> + </data> + </choice> + </define> + <define name="ccwSsidRange"> + <data type="string"> + <param name="pattern">(0x)?[0-3]</param> + </data> + </define> + <define name="ccwDevnoRange"> + <choice> + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,4}</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">65535</param> + </data> + </choice> + </define> + + <define name="cpuset"> + <data type="string"> + <param name="pattern">([0-9]+(-[0-9]+)?|\^[0-9]+)(,([0-9]+(-[0-9]+)?|\^[0-9]+))*</param> + </data> + </define> + + <define name="volName"> + <!-- directory pools allow almost any file name as a volume name --> + <data type="string"> + <param name="pattern">[^/]+</param> + <except> + <choice> + <value>.</value> + <value>..</value> + </choice> + </except> + </data> + </define> + + <define name="archnames"> + <choice> + <value>aarch64</value> + <value>alpha</value> + <value>armv6l</value> + <value>armv7l</value> + <value>cris</value> + <value>i686</value> + <value>ia64</value> + <value>lm32</value> + <value>loongarch64</value> + <value>m68k</value> + <value>microblaze</value> + <value>microblazeel</value> + <value>mips</value> + <value>mipsel</value> + <value>mips64</value> + <value>mips64el</value> + <value>openrisc</value> + <value>parisc</value> + <value>parisc64</value> + <value>ppc</value> + <value>ppc64</value> + <value>ppc64le</value> + <value>ppcemb</value> + <value>riscv32</value> + <value>riscv64</value> + <value>s390</value> + <value>s390x</value> + <value>sh4</value> + <value>sh4eb</value> + <value>sparc</value> + <value>sparc64</value> + <value>unicore32</value> + <value>x86_64</value> + <value>xtensa</value> + <value>xtensaeb</value> + </choice> + </define> + + <define name="PortNumber"> + <data type="int"> + <param name="minInclusive">-1</param> + <param name="maxInclusive">65535</param> + </data> + </define> + + <define name="sourceinfoadapter"> + <element name="adapter"> + <choice> + <group> + <!-- To keep back-compat, "type" is not mandatory for + scsi_host adapter --> + <optional> + <attribute name="type"> + <value>scsi_host</value> + </attribute> + </optional> + <choice> + <group> + <attribute name="name"> + <text/> + </attribute> + </group> + <group> + <interleave> + <element name="parentaddr"> + <optional> + <attribute name="unique_id"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <element name="address"> + <ref name="pciaddress"/> + </element> + </element> + </interleave> + </group> + </choice> + </group> + <group> + <attribute name="type"> + <value>fc_host</value> + </attribute> + <optional> + <attribute name="parent"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="parent_wwnn"> + <ref name="wwn"/> + </attribute> + </optional> + <optional> + <attribute name="parent_wwpn"> + <ref name="wwn"/> + </attribute> + </optional> + <optional> + <attribute name="parent_fabric_wwn"> + <ref name="wwn"/> + </attribute> + </optional> + <attribute name="wwnn"> + <ref name="wwn"/> + </attribute> + <attribute name="wwpn"> + <ref name="wwn"/> + </attribute> + </group> + </choice> + <empty/> + </element> + </define> + + <define name="isaaddress"> + <optional> + <attribute name="iobase"> + <data type="string"> + <param name="pattern">0x[a-fA-F0-9]{1,4}</param> + </data> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <data type="string"> + <param name="pattern">0x[a-fA-F0-9]</param> + </data> + </attribute> + </optional> + </define> + + <define name="link-speed-state"> + <optional> + <element name="link"> + <optional> + <attribute name="speed"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="state"> + <choice> + <value>unknown</value> + <value>notpresent</value> + <value>down</value> + <value>lowerlayerdown</value> + <value>testing</value> + <value>dormant</value> + <value>up</value> + </choice> + </attribute> + </optional> + </element> + </optional> + </define> + + <define name="virYesNo"> + <choice> + <value>yes</value> + <value>no</value> + </choice> + </define> + + <define name="virOnOff"> + <choice> + <value>on</value> + <value>off</value> + </choice> + </define> + + <!-- + title and description element, may be placed anywhere under the root + --> + <define name="title"> + <element name="title"> + <ref name="objectNameWithSlash"/> + </element> + </define> + + <define name="description"> + <element name="description"> + <text/> + </element> + </define> + + <define name="metadata"> + <element name="metadata"> + <zeroOrMore> + <ref name="customElement"/> + </zeroOrMore> + </element> + </define> + + <define name="customElement"> + <element> + <anyName/> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + </attribute> + <text/> + <ref name="customElement"/> + </choice> + </zeroOrMore> + </element> + </define> + + <define name="leaseUnit"> + <choice> + <value>seconds</value> + <value>minutes</value> + <value>hours</value> + </choice> + </define> + + <define name="hostdevDriver"> + <element name="driver"> + <optional> + <attribute name="name"> + <choice> + <value>kvm</value> + <value>vfio</value> + <value>xen</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="model"> + <ref name="genericName"/> + </attribute> + </optional> + <empty/> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/capability.rng b/src/main/resources/libvirt/rng/capability.rng new file mode 100644 index 0000000..a160694 --- /dev/null +++ b/src/main/resources/libvirt/rng/capability.rng @@ -0,0 +1,533 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt capabilities XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="cputypes.rng"/> + <start> + <ref name="capabilities"/> + </start> + + + <define name="capabilities"> + <element name="capabilities"> + <ref name="hostcaps"/> + + <zeroOrMore> + <ref name="guestcaps"/> + </zeroOrMore> + </element> + </define> + + <define name="hostcaps"> + <element name="host"> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <ref name="hostcpu"/> + <optional> + <ref name="power_management"/> + </optional> + <optional> + <ref name="iommu_support"/> + </optional> + <optional> + <ref name="migration"/> + </optional> + <optional> + <ref name="topology"/> + </optional> + <optional> + <ref name="cache"/> + </optional> + <optional> + <ref name="memory_bandwidth"/> + </optional> + <zeroOrMore> + <ref name="secmodel"/> + </zeroOrMore> + </element> + </define> + + <define name="secmodel"> + <element name="secmodel"> + <interleave> + <element name="model"> + <text/> + </element> + <element name="doi"> + <text/> + </element> + <zeroOrMore> + <element name="baselabel"> + <attribute name="type"> + <text/> + </attribute> + <text/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="power_management"> + <element name="power_management"> + <interleave> + <optional> + <element name="suspend_mem"> + <empty/> + </element> + </optional> + <optional> + <element name="suspend_disk"> + <empty/> + </element> + </optional> + <optional> + <element name="suspend_hybrid"> + <empty/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="iommu_support"> + <element name="iommu"> + <optional> + <attribute name="support"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </define> + + <define name="migration"> + <element name="migration_features"> + <optional> + <element name="live"> + <empty/> + </element> + </optional> + <optional> + <element name="uri_transports"> + <oneOrMore> + <element name="uri_transport"> + <choice> + <value>vpxmigr</value> + <value>tcp</value> + <value>rdma</value> + <value>vzmigr</value> + </choice> + </element> + </oneOrMore> + </element> + </optional> + </element> + </define> + + <define name="topology"> + <element name="topology"> + <element name="cells"> + <attribute name="num"> + <ref name="unsignedInt"/> + </attribute> + <oneOrMore> + <ref name="cell"/> + </oneOrMore> + </element> + <optional> + <ref name="numaInterconnects"/> + </optional> + </element> + </define> + + <define name="cell"> + <element name="cell"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + + <optional> + <ref name="memory"/> + </optional> + + <zeroOrMore> + <ref name="pagesNuma"/> + </zeroOrMore> + + <optional> + <element name="distances"> + <oneOrMore> + <ref name="numaDistance"/> + </oneOrMore> + </element> + </optional> + + <zeroOrMore> + <ref name="numaCache"/> + </zeroOrMore> + + <optional> + <element name="cpus"> + <attribute name="num"> + <ref name="unsignedInt"/> + </attribute> + <zeroOrMore> + <ref name="cpu"/> + </zeroOrMore> + </element> + </optional> + </element> + </define> + + <define name="memory"> + <element name="memory"> + <ref name="scaledInteger"/> + </element> + </define> + + <define name="cpu"> + <element name="cpu"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="socket_id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="die_id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="cluster_id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="core_id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="siblings"> + <ref name="cpuset"/> + </attribute> + </optional> + </element> + </define> + + <define name="cache"> + <element name="cache"> + <oneOrMore> + <element name="bank"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="level"> + <ref name="unsignedInt"/> + </attribute> + <ref name="cacheType"/> + <attribute name="size"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + <attribute name="cpus"> + <ref name="cpuset"/> + </attribute> + <zeroOrMore> + <element name="control"> + <attribute name="granularity"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="min"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + <ref name="cacheType"/> + <attribute name="maxAllocs"> + <ref name="unsignedInt"/> + </attribute> + </element> + </zeroOrMore> + </element> + </oneOrMore> + <optional> + <ref name="cpuMonitor"/> + </optional> + </element> + </define> + + <define name="cacheType"> + <attribute name="type"> + <choice> + <value>both</value> + <value>code</value> + <value>data</value> + </choice> + </attribute> + </define> + + <define name="memory_bandwidth"> + <element name="memory_bandwidth"> + <oneOrMore> + <element name="node"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="cpus"> + <ref name="cpuset"/> + </attribute> + <zeroOrMore> + <element name="control"> + <attribute name="granularity"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="min"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <attribute name="maxAllocs"> + <ref name="unsignedInt"/> + </attribute> + </element> + </zeroOrMore> + </element> + </oneOrMore> + <optional> + <ref name="cpuMonitor"/> + </optional> + </element> + </define> + + <define name="cpuMonitor"> + <element name="monitor"> + <optional> + <attribute name="level"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="reuseThreshold"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <attribute name="maxMonitors"> + <ref name="unsignedInt"/> + </attribute> + <oneOrMore> + <element name="feature"> + <attribute name="name"> + <ref name="monitorFeature"/> + </attribute> + </element> + </oneOrMore> + </element> + </define> + + <define name="monitorFeature"> + <data type="string"> + <param name="pattern">(llc_|mbm_)[a-zA-Z0-9\-_]+</param> + </data> + </define> + + <define name="guestcaps"> + <element name="guest"> + <ref name="ostype"/> + <ref name="arch"/> + <optional> + <ref name="features"/> + </optional> + </element> + </define> + + <define name="ostype"> + <element name="os_type"> + <choice> + <value>xen</value> <!-- Xen 3.0 pv --> + <value>linux</value> <!-- same as "xen" - meant to be legacy --> + <value>hvm</value> <!-- unmodified OS --> + <value>exe</value> <!-- For container based virt --> + <value>uml</value> <!-- user mode linux; NOT USED ANYMORE --> + </choice> + </element> + </define> + + <define name="arch"> + <element name="arch"> + <attribute name="name"> + <ref name="archnames"/> + </attribute> + <ref name="wordsize"/> + <optional> + <ref name="emulator"/> + </optional> + <optional> + <ref name="loader"/> + </optional> + <zeroOrMore> + <ref name="machine"/> + </zeroOrMore> + <oneOrMore> + <ref name="domain"/> + </oneOrMore> + </element> + </define> + + <define name="emulator"> + <element name="emulator"> + <ref name="absFilePath"/> + </element> + </define> + + <define name="loader"> + <element name="loader"> + <ref name="absFilePath"/> + </element> + </define> + + <define name="wordsize"> + <element name="wordsize"> + <choice> + <value>31</value> + <value>32</value> + <value>64</value> + </choice> + </element> + </define> + + <define name="machine"> + <element name="machine"> + <optional> + <attribute name="canonical"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="maxCpus"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="deprecated"> + <ref name="virYesNo"/> + </attribute> + </optional> + <text/> + </element> + </define> + + <define name="domain"> + <element name="domain"> + <attribute name="type"> + <choice> + <value>qemu</value> + <value>kqemu</value> + <value>kvm</value> + <value>xen</value> + <value>uml</value> <!-- NOT USED ANYMORE --> + <value>lxc</value> + <value>openvz</value> + <value>test</value> + <value>hvf</value> + </choice> + </attribute> + + <optional> + <ref name="emulator"/> + </optional> + <zeroOrMore> + <ref name="machine"/> + </zeroOrMore> + </element> + </define> + + <define name="features"> + <element name="features"> + <interleave> + <optional> + <element name="pae"> + <empty/> + </element> + </optional> + <optional> + <element name="nonpae"> + <empty/> + </element> + </optional> + <optional> + <element name="ia64_be"> + <empty/> + </element> + </optional> + <optional> + <element name="acpi"> + <ref name="featuretoggle"/> + <empty/> + </element> + </optional> + <optional> + <element name="apic"> + <ref name="featuretoggle"/> + <empty/> + </element> + </optional> + <optional> + <element name="cpuselection"> + <empty/> + </element> + </optional> + <optional> + <element name="deviceboot"> + <empty/> + </element> + </optional> + <optional> + <element name="disksnapshot"> + <ref name="featuretoggle"/> + <empty/> + </element> + </optional> + <optional> + <element name="hap"> + <ref name="featuretoggle"/> + <empty/> + </element> + </optional> + <optional> + <element name="externalSnapshot"> + <empty/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="featuretoggle"> + <attribute name="toggle"> + <ref name="virYesNo"/> + </attribute> + <attribute name="default"> + <ref name="virOnOff"/> + </attribute> + </define> + + <define name="pagesNuma"> + <element name="pages"> + <ref name="pagesElem"/> + <ref name="unsignedInt"/> + </element> + </define> + <define name="pagesElem"> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + <attribute name="size"> + <ref name="unsignedInt"/> + </attribute> + </define> +</grammar> diff --git a/src/main/resources/libvirt/rng/cpu.rng b/src/main/resources/libvirt/rng/cpu.rng new file mode 100644 index 0000000..d1eb674 --- /dev/null +++ b/src/main/resources/libvirt/rng/cpu.rng @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="cputypes.rng"/> + + <start> + <choice> + <ref name="guestcpu"/> + <ref name="hostcpu"/> + </choice> + </start> +</grammar> diff --git a/src/main/resources/libvirt/rng/cputypes.rng b/src/main/resources/libvirt/rng/cputypes.rng new file mode 100644 index 0000000..3a8910e --- /dev/null +++ b/src/main/resources/libvirt/rng/cputypes.rng @@ -0,0 +1,473 @@ +<?xml version="1.0"?> +<!-- CPU-related definitions used in multiple grammars --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <define name="cpuMode"> + <attribute name="mode"> + <choice> + <value>custom</value> + <value>host-model</value> + <value>host-passthrough</value> + <value>maximum</value> + </choice> + </attribute> + </define> + + <define name="cpuMatch"> + <attribute name="match"> + <choice> + <value>minimum</value> + <value>exact</value> + <value>strict</value> + </choice> + </attribute> + </define> + + <define name="cpuCheck"> + <attribute name="check"> + <choice> + <value>none</value> + <value>partial</value> + <value>full</value> + </choice> + </attribute> + </define> + + <define name="cpuModel"> + <element name="model"> + <optional> + <attribute name="fallback"> + <choice> + <value>allow</value> + <value>forbid</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="vendor_id"> + <data type="string"> + <param name="pattern">[^,]{12}</param> + </data> + </attribute> + </optional> + <choice> + <text/> + <empty/> + </choice> + </element> + </define> + + <define name="cpuVendor"> + <element name="vendor"> + <text/> + </element> + </define> + + <define name="cpuFeature"> + <element name="feature"> + <attribute name="policy"> + <choice> + <value>force</value> + <value>require</value> + <value>optional</value> + <value>disable</value> + <value>forbid</value> + </choice> + </attribute> + <attribute name="name"> + <ref name="featureName"/> + </attribute> + <empty/> + </element> + </define> + + <define name="cpuTopology"> + <element name="topology"> + <attribute name="sockets"> + <ref name="positiveInteger"/> + </attribute> + <optional> + <attribute name="dies"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <attribute name="clusters"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <attribute name="cores"> + <ref name="positiveInteger"/> + </attribute> + <attribute name="threads"> + <ref name="positiveInteger"/> + </attribute> + </element> + </define> + + <define name="cpuNuma"> + <element name="numa"> + <interleave> + <oneOrMore> + <ref name="numaCell"/> + </oneOrMore> + <optional> + <ref name="numaInterconnects"/> + </optional> + </interleave> + </element> + </define> + + <define name="numaCell"> + <element name="cell"> + <optional> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="cpus"> + <ref name="cpuset"/> + </attribute> + </optional> + <attribute name="memory"> + <ref name="memoryKB"/> + </attribute> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + <optional> + <attribute name="memAccess"> + <choice> + <value>shared</value> + <value>private</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="discard"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="distances"> + <oneOrMore> + <ref name="numaDistance"/> + </oneOrMore> + </element> + </optional> + <zeroOrMore> + <ref name="numaCache"/> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="numaDistance"> + <element name="sibling"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="value"> + <ref name="numaDistanceValue"/> + </attribute> + </element> + </define> + + <define name="numaCache"> + <element name="cache"> + <attribute name="level"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="associativity"> + <choice> + <value>none</value> + <value>direct</value> + <value>full</value> + </choice> + </attribute> + <attribute name="policy"> + <choice> + <value>none</value> + <value>writeback</value> + <value>writethrough</value> + </choice> + </attribute> + <interleave> + <element name="size"> + <attribute name="value"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </element> + <element name="line"> + <attribute name="value"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </element> + </interleave> + </element> + </define> + + <define name="numaInterconnects"> + <element name="interconnects"> + <interleave> + <zeroOrMore> + <element name="latency"> + <attribute name="initiator"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="target"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="cache"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <attribute name="type"> + <choice> + <value>access</value> + <value>read</value> + <value>write</value> + </choice> + </attribute> + <attribute name="value"> + <ref name="unsignedInt"/> + </attribute> + <empty/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="bandwidth"> + <attribute name="initiator"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="target"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="cache"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <attribute name="type"> + <choice> + <value>access</value> + <value>read</value> + <value>write</value> + </choice> + </attribute> + <attribute name="value"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <!-- Memory as an attribute is in KiB, no way to express a unit --> + <define name="memoryKB"> + <data type="unsignedLong"/> + </define> + <define name="featureName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9\-_\.]+</param> + </data> + </define> + + <define name="cpuCache"> + <element name="cache"> + <optional> + <attribute name="level"> + <choice> + <value>1</value> + <value>2</value> + <value>3</value> + </choice> + </attribute> + </optional> + <attribute name="mode"> + <choice> + <value>emulate</value> + <value>passthrough</value> + <value>disable</value> + </choice> + </attribute> + </element> + </define> + + <define name="cpuMaxPhysAddr"> + <element name="maxphysaddr"> + <attribute name="mode"> + <choice> + <value>emulate</value> + <value>passthrough</value> + </choice> + </attribute> + <optional> + <attribute name="bits"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="limit"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </define> + + <define name="hostcpu"> + <element name="cpu"> + <interleave> + <element name="arch"> + <ref name="archnames"/> + </element> + <optional> + <element name="features"> + <optional> + <element name="pae"><empty/></element> + </optional> + <optional> + <element name="nonpae"><empty/></element> + </optional> + <optional> + <element name="vmx"><empty/></element> + </optional> + <optional> + <element name="svm"><empty/></element> + </optional> + </element> + </optional> + <optional> + <element name="model"> + <text/> + </element> + </optional> + <optional> + <element name="vendor"> + <text/> + </element> + </optional> + <optional> + <element name="microcode"> + <attribute name="version"> + <ref name="positiveInteger"/> + </attribute> + </element> + </optional> + <optional> + <element name="signature"> + <attribute name="family"> + <ref name="positiveInteger"/> + </attribute> + <attribute name="model"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="stepping"> + <ref name="unsignedInt"/> + </attribute> + </element> + </optional> + <optional> + <element name="counter"> + <attribute name="name"> + <text/> + </attribute> + <attribute name="frequency"> + <ref name="positiveInteger"/> + </attribute> + <attribute name="scaling"> + <ref name="virYesNo"/> + </attribute> + </element> + </optional> + <optional> + <ref name="cpuTopology"/> + </optional> + <optional> + <ref name="cpuMaxPhysAddr"/> + </optional> + <zeroOrMore> + <element name="feature"> + <attribute name="name"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9\-_]+</param> + </data> + </attribute> + <empty/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="pages"> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + <attribute name="size"> + <ref name="unsignedInt"/> + </attribute> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="guestcpu"> + <element name="cpu"> + <optional> + <ref name="cpuMode"/> + </optional> + <optional> + <ref name="cpuMatch"/> + </optional> + <optional> + <ref name="cpuCheck"/> + </optional> + <optional> + <attribute name="migratable"> + <ref name="virOnOff"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="cpuModel"/> + </optional> + <optional> + <ref name="cpuVendor"/> + </optional> + <optional> + <ref name="cpuTopology"/> + </optional> + <zeroOrMore> + <ref name="cpuFeature"/> + </zeroOrMore> + <optional> + <ref name="cpuNuma"/> + </optional> + <optional> + <ref name="cpuCache"/> + </optional> + <optional> + <ref name="cpuMaxPhysAddr"/> + </optional> + </interleave> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domain.rng b/src/main/resources/libvirt/rng/domain.rng new file mode 100644 index 0000000..adc4386 --- /dev/null +++ b/src/main/resources/libvirt/rng/domain.rng @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- Grammar for accepting a domain element, both as top level, and + also suitable for inclusion in domainsnapshot.rng --> + <start> + <ref name="domain"/> + </start> + + <include href="domainoverrides.rng"/> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domainbackup.rng b/src/main/resources/libvirt/rng/domainbackup.rng new file mode 100644 index 0000000..80ba155 --- /dev/null +++ b/src/main/resources/libvirt/rng/domainbackup.rng @@ -0,0 +1,308 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt domain backup properties XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <start> + <ref name="domainbackup"/> + </start> + + <include href="domaincommon.rng"/> + + <define name="backupEncryption"> + <element name="encryption"> + <attribute name="format"> + <choice> + <value>luks</value> + </choice> + </attribute> + <optional> + <attribute name="engine"> + <choice> + <value>qemu</value> + </choice> + </attribute> + </optional> + <interleave> + <ref name="secret"/> + <optional> + <element name="cipher"> + <ref name="keycipher"/> + </element> + <element name="ivgen"> + <ref name="keyivgen"/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="domainbackup"> + <element name="domainbackup"> + <interleave> + <optional> + <element name="incremental"> + <text/> + </element> + </optional> + <choice> + <group> + <optional> + <attribute name="mode"> + <value>push</value> + </attribute> + </optional> + <ref name="backupDisksPush"/> + </group> + <group> + <attribute name="mode"> + <value>pull</value> + </attribute> + <interleave> + <element name="server"> + <optional> + <attribute name="tls"> + <ref name="virYesNo"/> + </attribute> + </optional> + <choice> + <group> + <optional> + <attribute name="transport"> + <value>tcp</value> + </attribute> + </optional> + <attribute name="name"> + <choice> + <ref name="dnsName"/> + <ref name="ipAddr"/> + </choice> + </attribute> + <optional> + <attribute name="port"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + <group> + <attribute name="transport"> + <value>unix</value> + </attribute> + <attribute name="socket"> + <ref name="absFilePath"/> + </attribute> + </group> + </choice> + </element> + <ref name="backupDisksPull"/> + </interleave> + </group> + </choice> + </interleave> + </element> + </define> + + + <define name="backupDiskMode"> + <optional> + <choice> + <attribute name="backupmode"> + <value>full</value> + </attribute> + <group> + <optional> + <attribute name="backupmode"> + <value>incremental</value> + </attribute> + </optional> + <optional> + <attribute name="incremental"/> + </optional> + </group> + </choice> + </optional> + </define> + + <define name="backupPushDriver"> + <optional> + <element name="driver"> + <attribute name="type"> + <ref name="storageFormat"/> + </attribute> + </element> + </optional> + </define> + + <define name="backupPullDriver"> + <optional> + <element name="driver"> + <attribute name="type"> + <value>qcow2</value> + </attribute> + </element> + </optional> + </define> + + <define name="backupAttr"> + <optional> + <attribute name="backup"> + <choice> + <value>yes</value> + </choice> + </attribute> + </optional> + </define> + + <define name="backupDisksPush"> + <optional> + <element name="disks"> + <oneOrMore> + <element name="disk"> + <attribute name="name"> + <ref name="diskTargetDev"/> + </attribute> + <ref name="backupDiskMode"/> + <choice> + <group> + <attribute name="backup"> + <value>no</value> + </attribute> + </group> + <!-- Allow to plainly select a disk for backup without any other config --> + <group> + <ref name="backupAttr"/> + </group> + <group> + <ref name="backupAttr"/> + <attribute name="type"> + <value>file</value> + </attribute> + <interleave> + <optional> + <element name="target"> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <interleave> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="backupEncryption"/> + </optional> + </interleave> + </element> + </optional> + <ref name="backupPushDriver"/> + </interleave> + </group> + <group> + <ref name="backupAttr"/> + <attribute name="type"> + <value>block</value> + </attribute> + <interleave> + <optional> + <element name="target"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <interleave> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="backupEncryption"/> + </optional> + </interleave> + </element> + </optional> + <ref name="backupPushDriver"/> + </interleave> + </group> + </choice> + </element> + </oneOrMore> + </element> + </optional> + </define> + + <define name="backupDisksPull"> + <optional> + <element name="disks"> + <oneOrMore> + <element name="disk"> + <attribute name="name"> + <ref name="diskTargetDev"/> + </attribute> + <ref name="backupDiskMode"/> + <optional> + <attribute name="exportname"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="exportbitmap"> + <text/> + </attribute> + </optional> + <choice> + <group> + <attribute name="backup"> + <value>no</value> + </attribute> + </group> + <group> + <optional> + <ref name="backupAttr"/> + <attribute name="type"> + <value>file</value> + </attribute> + </optional> + <optional> + <interleave> + <element name="scratch"> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <interleave> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="backupEncryption"/> + </optional> + </interleave> + </element> + <ref name="backupPullDriver"/> + </interleave> + </optional> + </group> + <group> + <ref name="backupAttr"/> + <attribute name="type"> + <value>block</value> + </attribute> + <interleave> + <element name="scratch"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <interleave> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="backupEncryption"/> + </optional> + </interleave> + </element> + <ref name="backupPullDriver"/> + </interleave> + </group> + </choice> + </element> + </oneOrMore> + </element> + </optional> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domaincaps.rng b/src/main/resources/libvirt/rng/domaincaps.rng new file mode 100644 index 0000000..e7aa4a1 --- /dev/null +++ b/src/main/resources/libvirt/rng/domaincaps.rng @@ -0,0 +1,457 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt domain capabilities XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="cputypes.rng"/> + <start> + <ref name="domainCapabilities"/> + </start> + + + <define name="domainCapabilities"> + <element name="domainCapabilities"> + <interleave> + <optional> + <element name="path"> + <ref name="absFilePath"/> + </element> + </optional> + <element name="domain"> + <text/> + </element> + <optional> + <element name="machine"> + <text/> + </element> + </optional> + <element name="arch"> + <text/> + </element> + <optional> + <ref name="vcpu"/> + </optional> + <optional> + <ref name="iothreads"/> + </optional> + <optional> + <ref name="os"/> + </optional> + <optional> + <ref name="cpu"/> + </optional> + <optional> + <ref name="memoryBacking"/> + </optional> + <optional> + <ref name="devices"/> + </optional> + <optional> + <ref name="features"/> + </optional> + </interleave> + </element> + </define> + + <define name="vcpu"> + <element name="vcpu"> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + <empty/> + </element> + </define> + + <define name="iothreads"> + <element name="iothreads"> + <ref name="supported"/> + <empty/> + </element> + </define> + + <define name="loader"> + <element name="loader"> + <ref name="supported"/> + <optional> + <ref name="value"/> + </optional> + <ref name="enum"/> + </element> + </define> + + <define name="os"> + <element name="os"> + <interleave> + <ref name="supported"/> + <ref name="enum"/> + <optional> + <ref name="loader"/> + </optional> + </interleave> + </element> + </define> + + <define name="cpu"> + <element name="cpu"> + <ref name="cpuHost"/> + <ref name="cpuMax"/> + <ref name="cpuHostModel"/> + <ref name="cpuCustom"/> + </element> + </define> + + <define name="cpuHost"> + <element name="mode"> + <attribute name="name"> + <value>host-passthrough</value> + </attribute> + <ref name="supported"/> + <optional> + <ref name="enum"/> + </optional> + </element> + </define> + + <define name="cpuMax"> + <element name="mode"> + <attribute name="name"> + <value>maximum</value> + </attribute> + <ref name="supported"/> + <optional> + <ref name="enum"/> + </optional> + </element> + </define> + + <define name="cpuHostModel"> + <element name="mode"> + <attribute name="name"> + <value>host-model</value> + </attribute> + <ref name="supported"/> + <optional> + <ref name="cpuModel"/> + <optional> + <ref name="cpuVendor"/> + </optional> + <optional> + <ref name="cpuMaxPhysAddr"/> + </optional> + <zeroOrMore> + <ref name="cpuFeature"/> + </zeroOrMore> + </optional> + </element> + </define> + + <define name="cpuCustom"> + <element name="mode"> + <attribute name="name"> + <value>custom</value> + </attribute> + <ref name="supported"/> + <zeroOrMore> + <element name="model"> + <attribute name="usable"> + <choice> + <value>yes</value> + <value>no</value> + <value>unknown</value> + </choice> + </attribute> + <optional> + <attribute name="deprecated"> + <ref name="virYesNo"/> + </attribute> + </optional> + <attribute name='vendor'> + <text/> + </attribute> + <text/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="memoryBacking"> + <element name="memoryBacking"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="devices"> + <element name="devices"> + <optional> + <ref name="disk"/> + </optional> + <optional> + <ref name="graphics"/> + </optional> + <optional> + <ref name="video"/> + </optional> + <optional> + <ref name="hostdev"/> + </optional> + <optional> + <ref name="rng"/> + </optional> + <optional> + <ref name="filesystem"/> + </optional> + <optional> + <ref name="tpm"/> + </optional> + <optional> + <ref name="redirdev"/> + </optional> + <optional> + <ref name="channel"/> + </optional> + <optional> + <ref name="crypto"/> + </optional> + </element> + </define> + + <define name="disk"> + <element name="disk"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="graphics"> + <element name="graphics"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="video"> + <element name="video"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="hostdev"> + <element name="hostdev"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="rng"> + <element name="rng"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="filesystem"> + <element name="filesystem"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="tpm"> + <element name="tpm"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="redirdev"> + <element name="redirdev"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="crypto"> + <element name="crypto"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="features"> + <element name="features"> + <optional> + <ref name="gic"/> + </optional> + <optional> + <ref name="vmcoreinfo"/> + </optional> + <optional> + <ref name="vmgenid"/> + </optional> + <optional> + <ref name="backingStoreInput"/> + </optional> + <optional> + <ref name="backup"/> + </optional> + <optional> + <ref name="async-teardown"/> + </optional> + <optional> + <ref name="s390-pv"/> + </optional> + <optional> + <ref name="sev"/> + </optional> + <optional> + <ref name="sgx"/> + </optional> + <optional> + <ref name="hyperv"/> + </optional> + </element> + </define> + + <define name="async-teardown"> + <element name="async-teardown"> + <ref name="supported"/> + </element> + </define> + + <define name="gic"> + <element name="gic"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="vmcoreinfo"> + <element name="vmcoreinfo"> + <ref name="supported"/> + </element> + </define> + + <define name="vmgenid"> + <element name="genid"> + <ref name="supported"/> + </element> + </define> + + <define name="backingStoreInput"> + <element name="backingStoreInput"> + <ref name="supported"/> + </element> + </define> + + <define name="backup"> + <element name="backup"> + <ref name="supported"/> + </element> + </define> + + <define name="s390-pv"> + <element name="s390-pv"> + <ref name="supported"/> + </element> + </define> + + <define name="sev"> + <element name="sev"> + <ref name="supported"/> + <optional> + <element name="cbitpos"> + <data type="unsignedInt"/> + </element> + <element name="reducedPhysBits"> + <data type="unsignedInt"/> + </element> + <element name="maxGuests"> + <data type="unsignedInt"/> + </element> + <element name="maxESGuests"> + <data type="unsignedInt"/> + </element> + </optional> + </element> + </define> + + <define name="sgx"> + <element name="sgx"> + <ref name="supported"/> + <optional> + <element name="flc"> + <ref name="virYesNo"/> + </element> + <element name="sgx1"> + <ref name="virYesNo"/> + </element> + <element name="sgx2"> + <ref name="virYesNo"/> + </element> + <element name="section_size"> + <attribute name="unit"> + <value>KiB</value> + </attribute> + <data type="unsignedLong"/> + </element> + <optional> + <element name="sections"> + <zeroOrMore> + <element name="section"> + <attribute name="node"> + <data type="unsignedInt"/> + </attribute> + <attribute name="size"> + <data type="unsignedLong"/> + </attribute> + <attribute name="unit"> + <value>KiB</value> + </attribute> + </element> + </zeroOrMore> + </element> + </optional> + </optional> + </element> + </define> + + <define name="hyperv"> + <element name="hyperv"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + + <define name="value"> + <zeroOrMore> + <element name="value"> + <text/> + </element> + </zeroOrMore> + </define> + + <define name="supported"> + <attribute name="supported"> + <ref name="virYesNo"/> + </attribute> + </define> + + <define name="enum"> + <zeroOrMore> + <element name="enum"> + <attribute name="name"> + <text/> + </attribute> + <ref name="value"/> + </element> + </zeroOrMore> + </define> +</grammar> diff --git a/src/main/resources/libvirt/rng/domaincheckpoint.rng b/src/main/resources/libvirt/rng/domaincheckpoint.rng new file mode 100644 index 0000000..72c4186 --- /dev/null +++ b/src/main/resources/libvirt/rng/domaincheckpoint.rng @@ -0,0 +1,94 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt domain checkpoint properties XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="domaincheckpoint"/> + </start> + + <include href="domaincommon.rng"/> + + <define name="domaincheckpoint"> + <element name="domaincheckpoint"> + <interleave> + <optional> + <element name="name"> + <ref name="checkpointName"/> + </element> + </optional> + <optional> + <element name="description"> + <text/> + </element> + </optional> + <optional> + <element name="creationTime"> + <ref name="unsignedLong"/> + </element> + </optional> + <optional> + <element name="disks"> + <oneOrMore> + <ref name="diskcheckpoint"/> + </oneOrMore> + </element> + </optional> + <optional> + <!-- Nested grammar ensures that any of our overrides of + storagecommon/domaincommon defines do not conflict + with any domain.rng overrides. --> + <grammar> + <include href="domain.rng"/> + </grammar> + </optional> + <optional> + <element name="parent"> + <element name="name"> + <ref name="checkpointName"/> + </element> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="diskcheckpoint"> + <element name="disk"> + <attribute name="name"> + <choice> + <ref name="diskTargetDev"/> + <ref name="absFilePath"/> + </choice> + </attribute> + <choice> + <attribute name="checkpoint"> + <value>no</value> + </attribute> + <group> + <optional> + <attribute name="checkpoint"> + <value>bitmap</value> + </attribute> + </optional> + <optional> + <attribute name="bitmap"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="size"> + <ref name="unsignedLong"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + <define name="checkpointName"> + <data type="string"> + <!-- Notably: no leading "." and no embedded "/" or newline --> + <param name="pattern">[a-zA-Z0-9_\-][a-zA-Z0-9_\-.]*</param> + </data> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domaincommon.rng b/src/main/resources/libvirt/rng/domaincommon.rng new file mode 100644 index 0000000..d84e030 --- /dev/null +++ b/src/main/resources/libvirt/rng/domaincommon.rng @@ -0,0 +1,8648 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- domain-related definitions used in multiple grammars --> + <include href="basictypes.rng"/> + <include href="storagecommon.rng"/> + <include href="networkcommon.rng"/> + <include href="cputypes.rng"/> + <include href="nwfilter_params.rng"/> + <include href="privatedata.rng"/> + + <define name="createMode"> + <data type="unsignedInt"> + <param name="pattern">0[0-7]{3}|[0-7]{1,3}</param> + </data> + </define> + + <!-- + We handle only document defining a domain + --> + <define name="domain"> + <element name="domain"> + <ref name="domaincontents"/> + </element> + </define> + + <!-- this element is used as a child of a snapshot definition --> + <define name="inactiveDomain"> + <element name="inactiveDomain"> + <ref name="domaincontents"/> + </element> + </define> + + <define name="domaincontents"> + <ref name="hvs"/> + <interleave> + <ref name="ids"/> + <optional> + <ref name="title"/> + </optional> + <optional> + <ref name="description"/> + </optional> + <optional> + <ref name="metadata"/> + </optional> + <optional> + <ref name="guestcpu"/> + </optional> + <zeroOrMore> + <ref name="sysinfo"/> + </zeroOrMore> + <ref name="os"/> + <ref name="clock"/> + <ref name="resources"/> + <ref name="features"/> + <ref name="events"/> + <optional> + <ref name="pm"/> + </optional> + <optional> + <ref name="perf"/> + </optional> + <optional> + <ref name="idmap"/> + </optional> + <optional> + <ref name="devices"/> + </optional> + <zeroOrMore> + <ref name="seclabel"/> + </zeroOrMore> + <optional> + <ref name="qemucmdline"/> + </optional> + <optional> + <ref name="qemucapabilities"/> + </optional> + <optional> + <ref name="qemudeprecation"/> + </optional> + <optional> + <ref name="qemuoverride"/> + </optional> + <optional> + <ref name="lxcsharens"/> + </optional> + <optional> + <ref name="keywrap"/> + </optional> + <optional> + <ref name="launchSecurity"/> + </optional> + <optional> + <ref name="bhyvecmdline"/> + </optional> + <optional> + <ref name="xencmdline"/> + </optional> + <optional> + <ref name="vmwaredatacenterpath"/> + </optional> + </interleave> + </define> + + <define name="seclabel"> + <element name="seclabel"> + <optional> + <attribute name="model"> + <text/> + </attribute> + </optional> + <choice> + <group> + <!-- with dynamic label (default), relabel must be yes, baselabel + is optional, and label and imagelabel are output-only --> + <optional> + <attribute name="type"> + <value>dynamic</value> + </attribute> + </optional> + <optional> + <attribute name="relabel"> + <value>yes</value> + </attribute> + </optional> + <interleave> + <optional> + <element name="label"> + <text/> + </element> + </optional> + <optional> + <element name="imagelabel"> + <text/> + </element> + </optional> + <optional> + <element name="baselabel"> + <text/> + </element> + </optional> + </interleave> + </group> + <group> + <!-- with static label, relabel can be either format (default + no), label is required, imagelabel is output-only, and no + baselabel is present --> + <attribute name="type"> + <value>static</value> + </attribute> + <optional> + <attribute name="relabel"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <element name="label"> + <text/> + </element> + <optional> + <element name="imagelabel"> + <text/> + </element> + </optional> + </interleave> + </group> + <group> + <!-- with none, relabel must be no if present --> + <attribute name="type"> + <value>none</value> + </attribute> + <optional> + <attribute name="relabel"> + <value>no</value> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + <define name="devSeclabel"> + <element name="seclabel"> + <!-- A per-device seclabel override is more limited, either + relabel=no or a <label> must be present on input; + output also can include labelskip=yes. --> + <optional> + <attribute name="model"> + <text/> + </attribute> + </optional> + <choice> + <group> + <attribute name="relabel"> + <value>no</value> + </attribute> + </group> + <group> + <attribute name="labelskip"> + <value>yes</value> + </attribute> + </group> + <group> + <optional> + <attribute name="relabel"> + <value>yes</value> + </attribute> + </optional> + <oneOrMore> + <element name="label"> + <text/> + </element> + </oneOrMore> + </group> + </choice> + </element> + </define> + <define name="hvs"> + <attribute name="type"> + <choice> + <value>qemu</value> + <value>kqemu</value> + <value>kvm</value> + <value>xen</value> + <value>lxc</value> + <value>uml</value> <!-- NOT USED ANYMORE --> + <value>openvz</value> + <value>test</value> + <value>vmware</value> + <value>hyperv</value> + <value>vbox</value> + <value>phyp</value> <!-- NOT USED ANYMORE --> + <value>vz</value> + <value>bhyve</value> + <value>hvf</value> + </choice> + </attribute> + </define> + <define name="os"> + <choice> + <ref name="osxen"/> + <ref name="oshvm"/> + <ref name="osexe"/> + </choice> + </define> + + <define name="osxen"> + <choice> + <group> + <interleave> + <optional> + <ref name="bootloader"/> + </optional> + <element name="os"> + <interleave> + <ref name="ostypexen"/> + <ref name="osbootkernel"/> + </interleave> + </element> + </interleave> + </group> + <group> + <interleave> + <ref name="bootloader"/> + <optional> + <element name="os"> + <interleave> + <ref name="ostypexen"/> + <optional> + <ref name="osbootkernel"/> + </optional> + </interleave> + </element> + </optional> + </interleave> + </group> + </choice> + </define> + + <define name="oshvm"> + <interleave> + <optional> + <ref name="bootloader"/> + </optional> + <element name="os"> + <interleave> + <optional> + <attribute name="firmware"> + <choice> + <value>bios</value> + <value>efi</value> + </choice> + </attribute> + </optional> + <ref name="ostypehvm"/> + <optional> + <element name="firmware"> + <oneOrMore> + <element name="feature"> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + <attribute name="name"> + <choice> + <value>enrolled-keys</value> + <value>secure-boot</value> + </choice> + </attribute> + </element> + </oneOrMore> + </element> + </optional> + <optional> + <element name="loader"> + <optional> + <attribute name="readonly"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="secure"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="type"> + <choice> + <value>rom</value> + <value>pflash</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="stateless"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <ref name="pflashFormat"/> + </optional> + <optional> + <ref name="absFilePath"/> + </optional> + </element> + </optional> + <optional> + <element name="nvram"> + <optional> + <attribute name="template"> + <ref name="absFilePath"/> + </attribute> + </optional> + <optional> + <ref name="pflashFormat"/> + </optional> + <optional> + <choice> + <group> + <ref name="absFilePath"/> + </group> + <group> + <ref name="diskSource"/> + </group> + </choice> + </optional> + </element> + </optional> + <optional> + <ref name="osbootkernel"/> + </optional> + <zeroOrMore> + <ref name="osbootdev"/> + </zeroOrMore> + <optional> + <element name="bootmenu"> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="timeout"> + <ref name="unsignedShort"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <ref name="smbios"/> + </optional> + <optional> + <ref name="bios"/> + </optional> + <optional> + <ref name="acpiTable"/> + </optional> + </interleave> + </element> + </interleave> + </define> + + <define name="ostypexen"> + <element name="type"> + <optional> + <attribute name="arch"> + <choice> + <value>i686</value> + <value>x86_64</value> + <value>ia64</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="machine"> + <choice> + <value>xenpv</value> + <value>xenfv</value> + <value>xenpvh</value> + </choice> + </attribute> + </optional> + <choice> + <value>xen</value> + <value>linux</value> + <value>xenpvh</value> + </choice> + </element> + </define> + <define name="ostypehvm"> + <element name="type"> + <optional> + <attribute name="arch"> + <ref name="archnames"/> + </attribute> + </optional> + <optional> + <attribute name="machine"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.\-]+</param> + </data> + </attribute> + </optional> + <value>hvm</value> + </element> + </define> + + <define name="osexe"> + <element name="os"> + <interleave> + <element name="type"> + <optional> + <attribute name="arch"> + <ref name="archnames"/> + </attribute> + </optional> + <value>exe</value> + </element> + <optional> + <element name="init"> + <ref name="absFilePath"/> + </element> + </optional> + <zeroOrMore> + <element name="initarg"> + <text/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="initenv"> + <attribute name="name"> + <data type="string"> + <param name="pattern">[a-zA-Z_]+[a-zA-Z0-9_]*</param> + </data> + </attribute> + <text/> + </element> + </zeroOrMore> + <optional> + <element name="initdir"> + <ref name="absFilePath"/> + </element> + </optional> + <optional> + <interleave> + <element name="inituser"> + <ref name="genericName"/> + </element> + <element name="initgroup"> + <ref name="genericName"/> + </element> + </interleave> + </optional> + </interleave> + </element> + </define> + + <define name="keywrap"> + <element name="keywrap"> + <oneOrMore> + <element name="cipher"> + <attribute name="name"> + <choice> + <value>aes</value> + <value>dea</value> + </choice> + </attribute> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + </element> + </oneOrMore> + </element> + </define> + + <define name="launchSecurity"> + <element name="launchSecurity"> + <choice> + <group> + <ref name="launchSecuritySEV"/> + </group> + <group> + <attribute name="type"> + <value>s390-pv</value> + </attribute> + </group> + </choice> + </element> + </define> + + <define name="launchSecuritySEV"> + <attribute name="type"> + <value>sev</value> + </attribute> + <optional> + <attribute name="kernelHashes"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="cbitpos"> + <data type="unsignedInt"/> + </element> + </optional> + <optional> + <element name="reducedPhysBits"> + <data type="unsignedInt"/> + </element> + </optional> + <element name="policy"> + <ref name="hexuint"/> + </element> + <optional> + <element name="handle"> + <ref name="unsignedInt"/> + </element> + </optional> + <optional> + <element name="dhCert"> + <data type="string"/> + </element> + </optional> + <optional> + <element name="session"> + <data type="string"/> + </element> + </optional> + </interleave> + </define> + + <!-- + Enable or disable perf events for the domain. For each + of the events the following rules apply: + on: the event will be forcefully enabled + off: the event will be forcefully disabled + not specified: the event will be disabled by default + --> + <define name="perf"> + <element name="perf"> + <oneOrMore> + <element name="event"> + <attribute name="name"> + <choice> + <value>cmt</value> + <value>mbmt</value> + <value>mbml</value> + <value>cpu_cycles</value> + <value>instructions</value> + <value>cache_references</value> + <value>cache_misses</value> + <value>branch_instructions</value> + <value>branch_misses</value> + <value>bus_cycles</value> + <value>stalled_cycles_frontend</value> + <value>stalled_cycles_backend</value> + <value>ref_cpu_cycles</value> + <value>cpu_clock</value> + <value>task_clock</value> + <value>page_faults</value> + <value>context_switches</value> + <value>cpu_migrations</value> + <value>page_faults_min</value> + <value>page_faults_maj</value> + <value>alignment_faults</value> + <value>emulation_faults</value> + </choice> + </attribute> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + </element> + </oneOrMore> + </element> + </define> + + <define name="fibrechannel"> + <element name="fibrechannel"> + <attribute name="appid"> + <data type="string"> + <!-- All printable characters --> + <param name="pattern">[ -~]{1,128}</param> + </data> + </attribute> + </element> + </define> + + <!-- + The Identifiers can be: + - an optional id attribute with a number on the domain element + - a mandatory name + - an optional uuid + --> + <define name="ids"> + <optional> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <interleave> + <element name="name"> + <ref name="objectNameWithSlash"/> + </element> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <optional> + <element name="genid"> + <choice> + <ref name="UUID"/> + <empty/> + </choice> + </element> + </optional> + </interleave> + </define> + <define name="idmap"> + <element name="idmap"> + <interleave> + <zeroOrMore> + <element name="uid"> + <attribute name="start"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="target"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="count"> + <ref name="unsignedInt"/> + </attribute> + <empty/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="gid"> + <attribute name="start"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="target"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="count"> + <ref name="unsignedInt"/> + </attribute> + <empty/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + <!-- + Resources usage defines the amount of memory (maximum and possibly + current usage) and number of virtual CPUs used by that domain. + We can't check here the rule that currentMemory <= memory + --> + <define name="resources"> + <interleave> + <optional> + <element name="memory"> + <ref name="scaledInteger"/> + <optional> + <attribute name="dumpCore"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="maxMemory"> + <ref name="scaledInteger"/> + <optional> + <attribute name="slots"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="currentMemory"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="memoryBacking"> + <interleave> + <optional> + <element name="hugepages"> + <zeroOrMore> + <element name="page"> + <attribute name="size"> + <ref name="unsignedLong"/> + </attribute> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + <optional> + <attribute name="nodeset"> + <ref name="cpuset"/> + </attribute> + </optional> + <empty/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="nosharepages"> + <empty/> + </element> + </optional> + <optional> + <element name="locked"> + <empty/> + </element> + </optional> + <optional> + <element name="source"> + <attribute name="type"> + <choice> + <value>file</value> + <value>anonymous</value> + <value>memfd</value> + </choice> + </attribute> + </element> + </optional> + <optional> + <element name="access"> + <attribute name="mode"> + <choice> + <value>shared</value> + <value>private</value> + </choice> + </attribute> + </element> + </optional> + <optional> + <element name="allocation"> + <optional> + <attribute name="mode"> + <choice> + <value>immediate</value> + <value>ondemand</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="threads"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="discard"> + <empty/> + </element> + </optional> + </interleave> + </element> + </optional> + + <optional> + <element name="vcpu"> + <optional> + <attribute name="placement"> + <choice> + <value>static</value> + <value>auto</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="cpuset"> + <ref name="cpuset"/> + </attribute> + </optional> + <optional> + <attribute name="current"> + <ref name="countCPU"/> + </attribute> + </optional> + <ref name="countCPU"/> + </element> + </optional> + + <optional> + <element name="vcpus"> + <zeroOrMore> + <element name="vcpu"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="hotpluggable"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="order"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + + <optional> + <element name="iothreads"> + <ref name="unsignedInt"/> + </element> + </optional> + + <optional> + <element name="iothreadids"> + <zeroOrMore> + <element name="iothread"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="thread_pool_min"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="thread_pool_max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <element name="poll"> + <optional> + <attribute name="max"> + <ref name="unsignedLong"/> + </attribute> + </optional> + <optional> + <attribute name="grow"> + <ref name="unsignedLong"/> + </attribute> + </optional> + <optional> + <attribute name="shrink"> + <ref name="unsignedLong"/> + </attribute> + </optional> + </element> + </optional> + </element> + </zeroOrMore> + </element> + </optional> + + <optional> + <element name="defaultiothread"> + <optional> + <attribute name="thread_pool_min"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="thread_pool_max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + + <optional> + <ref name="blkiotune"/> + </optional> + + <optional> + <ref name="memtune"/> + </optional> + + <optional> + <ref name="cputune"/> + </optional> + + <optional> + <ref name="numatune"/> + </optional> + + <optional> + <ref name="respartition"/> + </optional> + </interleave> + </define> + + <!-- The Blkio cgroup related tunables would go in the blkiotune --> + <define name="blkiotune"> + <element name="blkiotune"> + <interleave> + <!-- I/O weight the VM can use --> + <optional> + <element name="weight"> + <ref name="weight"/> + </element> + </optional> + <zeroOrMore> + <element name="device"> + <interleave> + <element name="path"> + <ref name="absFilePath"/> + </element> + <optional> + <element name="weight"> + <ref name="weight"/> + </element> + </optional> + <optional> + <element name="read_iops_sec"> + <data type="unsignedInt"/> + </element> + </optional> + <optional> + <element name="write_iops_sec"> + <data type="unsignedInt"/> + </element> + </optional> + <optional> + <element name="read_bytes_sec"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_bytes_sec"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <!-- All the memory/swap related tunables would go in the memtune --> + <define name="memtune"> + <element name="memtune"> + <interleave> + <!-- Maximum memory the VM can use --> + <optional> + <element name="hard_limit"> + <ref name="scaledInteger"/> + </element> + </optional> + <!-- Minimum memory ascertained for the VM during contention --> + <optional> + <element name="soft_limit"> + <ref name="scaledInteger"/> + </element> + </optional> + <!-- Minimum amount of memory required to start the VM --> + <optional> + <element name="min_guarantee"> + <ref name="scaledInteger"/> + </element> + </optional> + <!-- Maximum swap area the VM can use --> + <optional> + <element name="swap_hard_limit"> + <ref name="scaledInteger"/> + </element> + </optional> + </interleave> + </element> + </define> + + <!-- All the cpu related tunables would go in the cputune --> + <define name="cputune"> + <element name="cputune"> + <interleave> + <optional> + <element name="shares"> + <ref name="cpushares"/> + </element> + </optional> + <optional> + <element name="global_period"> + <ref name="cpuperiod"/> + </element> + </optional> + <optional> + <element name="global_quota"> + <ref name="cpuquota"/> + </element> + </optional> + <optional> + <element name="period"> + <ref name="cpuperiod"/> + </element> + </optional> + <optional> + <element name="quota"> + <ref name="cpuquota"/> + </element> + </optional> + <optional> + <element name="emulator_period"> + <ref name="cpuperiod"/> + </element> + </optional> + <optional> + <element name="emulator_quota"> + <ref name="cpuquota"/> + </element> + </optional> + <optional> + <element name="iothread_period"> + <ref name="cpuperiod"/> + </element> + </optional> + <optional> + <element name="iothread_quota"> + <ref name="cpuquota"/> + </element> + </optional> + <zeroOrMore> + <element name="vcpupin"> + <attribute name="vcpu"> + <ref name="vcpuid"/> + </attribute> + <attribute name="cpuset"> + <ref name="cpuset"/> + </attribute> + </element> + </zeroOrMore> + <optional> + <element name="emulatorpin"> + <attribute name="cpuset"> + <ref name="cpuset"/> + </attribute> + </element> + </optional> + <zeroOrMore> + <element name="iothreadpin"> + <attribute name="iothread"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="cpuset"> + <ref name="cpuset"/> + </attribute> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="vcpusched"> + <optional> + <attribute name="vcpus"> + <ref name="cpuset"/> + </attribute> + </optional> + <ref name="schedparam"/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="iothreadsched"> + <optional> + <attribute name="iothreads"> + <ref name="cpuset"/> + </attribute> + </optional> + <ref name="schedparam"/> + </element> + </zeroOrMore> + <optional> + <element name="emulatorsched"> + <ref name="schedparam"/> + </element> + </optional> + <zeroOrMore> + <element name="cachetune"> + <attribute name="vcpus"> + <ref name="cpuset"/> + </attribute> + <optional> + <attribute name="id"> + <data type="string"/> + </attribute> + </optional> + <oneOrMore> + <choice> + <element name="cache"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="level"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="type"> + <choice> + <value>both</value> + <value>code</value> + <value>data</value> + </choice> + </attribute> + <attribute name="size"> + <ref name="unsignedLong"/> + </attribute> + <optional> + <attribute name="unit"> + <ref name="unit"/> + </attribute> + </optional> + </element> + <element name="monitor"> + <attribute name="level"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="vcpus"> + <ref name="cpuset"/> + </attribute> + </element> + </choice> + </oneOrMore> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="memorytune"> + <attribute name="vcpus"> + <ref name="cpuset"/> + </attribute> + <oneOrMore> + <choice> + <element name="node"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="bandwidth"> + <ref name="unsignedInt"/> + </attribute> + </element> + <element name="monitor"> + <attribute name="vcpus"> + <ref name="cpuset"/> + </attribute> + </element> + </choice> + </oneOrMore> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="schedparam"> + <choice> + <group> + <attribute name="scheduler"> + <choice> + <value>batch</value> + <value>idle</value> + </choice> + </attribute> + </group> + <group> + <attribute name="scheduler"> + <choice> + <value>fifo</value> + <value>rr</value> + </choice> + </attribute> + <attribute name="priority"> + <ref name="unsignedShort"/> + </attribute> + </group> + </choice> + </define> + + <!-- All the NUMA related tunables would go in the numatune --> + <define name="numatune"> + <element name="numatune"> + <interleave> + <optional> + <element name="memory"> + <optional> + <attribute name="mode"> + <choice> + <value>strict</value> + <value>preferred</value> + <value>interleave</value> + <value>restrictive</value> + </choice> + </attribute> + </optional> + <choice> + <group> + <optional> + <attribute name="placement"> + <value>static</value> + </attribute> + </optional> + <optional> + <attribute name="nodeset"> + <ref name="cpuset"/> + </attribute> + </optional> + </group> + <attribute name="placement"> + <value>auto</value> + </attribute> + </choice> + </element> + </optional> + <zeroOrMore> + <element name="memnode"> + <attribute name="cellid"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="mode"> + <choice> + <value>strict</value> + <value>preferred</value> + <value>interleave</value> + <value>restrictive</value> + </choice> + </attribute> + <attribute name="nodeset"> + <ref name="cpuset"/> + </attribute> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="respartition"> + <element name="resource"> + <optional> + <element name="partition"> + <ref name="absFilePath"/> + </element> + </optional> + <optional> + <ref name="fibrechannel"/> + </optional> + </element> + </define> + + <define name="clock"> + <optional> + <element name="clock"> + <choice> + <group> + <attribute name="offset"> + <choice> + <value>localtime</value> + <value>utc</value> + </choice> + </attribute> + <optional> + <attribute name="adjustment"> + <choice> + <ref name="timeDelta"/> + <value>reset</value> + </choice> + </attribute> + </optional> + </group> + <group> + <attribute name="offset"> + <value>timezone</value> + </attribute> + <optional> + <attribute name="timezone"> + <ref name="timeZone"/> + </attribute> + </optional> + </group> + <group> + <attribute name="offset"> + <value>variable</value> + </attribute> + <optional> + <attribute name="adjustment"> + <ref name="timeDelta"/> + </attribute> + </optional> + <optional> + <attribute name="basis"> + <choice> + <value>utc</value> + <value>localtime</value> + </choice> + </attribute> + </optional> + </group> + <group> + <attribute name="offset"> + <value>absolute</value> + </attribute> + <attribute name="start"> + <ref name="unsignedLong"/> + </attribute> + </group> + </choice> + <zeroOrMore> + <ref name="timer"/> + </zeroOrMore> + </element> + </optional> + </define> + <define name="timer"> + <element name="timer"> + <choice> + <group> + <attribute name="name"> + <choice> + <value>platform</value> + <value>rtc</value> + </choice> + </attribute> + <optional> + <attribute name="track"> + <choice> + <value>boot</value> + <value>guest</value> + <value>wall</value> + <value>realtime</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="tickpolicy"/> + </optional> + </group> + <group> + <attribute name="name"> + <value>tsc</value> + </attribute> + <optional> + <ref name="tickpolicy"/> + </optional> + <optional> + <attribute name="frequency"> + <ref name="unsignedLong"/> + </attribute> + </optional> + <optional> + <attribute name="mode"> + <choice> + <value>auto</value> + <value>native</value> + <value>emulate</value> + <value>paravirt</value> + <value>smpsafe</value> + </choice> + </attribute> + </optional> + </group> + <group> + <attribute name="name"> + <choice> + <value>hpet</value> + <value>pit</value> + <value>armvtimer</value> + </choice> + </attribute> + <optional> + <ref name="tickpolicy"/> + </optional> + </group> + <group> + <attribute name="name"> + <choice> + <value>kvmclock</value> + <value>hypervclock</value> + </choice> + </attribute> + </group> + </choice> + <optional> + <attribute name="present"> + <ref name="virYesNo"/> + </attribute> + </optional> + <empty/> + </element> + </define> + + <define name="tickpolicy"> + <choice> + <group> + <attribute name="tickpolicy"> + <choice> + <value>delay</value> + <value>merge</value> + <value>discard</value> + </choice> + </attribute> + </group> + <group> + <attribute name="tickpolicy"> + <value>catchup</value> + </attribute> + <optional> + <element name="catchup"> + <optional> + <attribute name="threshold"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="slew"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="limit"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + </group> + </choice> + </define> +<!-- + A bootloader may be used to extract the OS information instead of + defining the OS parameter in the instance. It points just to the + binary or script used to extract the data from the first disk device. + --> + <define name="bootloader"> + <interleave> + <optional> + <element name="bootloader"> + <choice> + <text/> + <empty/> + </choice> + </element> + </optional> + <optional> + <element name="bootloader_args"> + <text/> + </element> + </optional> + </interleave> + </define> + <define name="osbootkernel"> + <interleave> + <optional> + <element name="kernel"> + <ref name="absFilePath"/> + </element> + </optional> + <optional> + <element name="initrd"> + <ref name="absFilePath"/> + </element> + </optional> + <optional> + <element name="root"> + <ref name="absFilePath"/> + </element> + </optional> + <optional> + <element name="cmdline"> + <text/> + </element> + </optional> + <optional> + <element name="dtb"> + <ref name="absFilePath"/> + </element> + </optional> + </interleave> + </define> + <define name="osbootdev"> + <element name="boot"> + <attribute name="dev"> + <choice> + <value>hd</value> + <value>fd</value> + <value>cdrom</value> + <value>network</value> + </choice> + </attribute> + <empty/> + </element> + </define> + <define name="diskspec"> + <interleave> + <optional> + <ref name="diskDriver"/> + </optional> + <optional> + <ref name="diskMirror"/> + </optional> + <optional> + <ref name="diskAuth"/> + </optional> + <ref name="diskTarget"/> + <optional> + <ref name="deviceBoot"/> + </optional> + <optional> + <element name="backenddomain"> + <attribute name="name"> + <ref name="objectNameWithSlash"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="readonly"> + <empty/> + </element> + </optional> + <optional> + <element name="shareable"> + <empty/> + </element> + </optional> + <optional> + <element name="transient"> + <optional> + <attribute name="shareBacking"> + <ref name='virYesNo'/> + </attribute> + </optional> + <empty/> + </element> + </optional> + <optional> + <element name="serial"> + <ref name="diskSerial"/> + </element> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="diskIoTune"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="geometry"/> + </optional> + <optional> + <ref name="diskBlockIo"/> + </optional> + <optional> + <element name="wwn"> + <ref name="wwn"/> + </element> + </optional> + <optional> + <element name="vendor"> + <data type="string"> + <!-- All printable characters --> + <param name="pattern">[ -~]{0,8}</param> + </data> + </element> + </optional> + <optional> + <element name="product"> + <data type="string"> + <!-- All printable characters --> + <param name="pattern">[ -~]{0,16}</param> + </data> + </element> + </optional> + </interleave> + </define> + <define name="snapshot"> + <attribute name="snapshot"> + <choice> + <value>no</value> + <value>internal</value> + <value>external</value> + <value>manual</value> + </choice> + </attribute> + </define> + + <define name="lease"> + <element name="lease"> + <interleave> + <element name="lockspace"> + <text/> + </element> + <element name="key"> + <text/> + </element> + <element name="target"> + <attribute name="path"> + <text/> + </attribute> + <optional> + <attribute name="offset"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </interleave> + </element> + </define> + + <define name="startupPolicy"> + <attribute name="startupPolicy"> + <choice> + <value>mandatory</value> + <value>requisite</value> + <value>optional</value> + </choice> + </attribute> + </define> + + <!-- + A disk description can be either of type file or block + The name of the attribute on the source element depends on the type + + --> + <define name="disk"> + <element name="disk"> + <choice> + <group> + <optional> + <attribute name="device"> + <choice> + <value>floppy</value> + <value>disk</value> + <value>cdrom</value> + </choice> + </attribute> + </optional> + <interleave> + <ref name="diskSource"/> + <ref name="diskSpecsExtra"/> + </interleave> + </group> + <group> + <attribute name="device"> + <value>lun</value> + </attribute> + <optional> + <ref name="rawIO"/> + </optional> + <optional> + <ref name="sgIO"/> + </optional> + <interleave> + <choice> + <ref name="diskSourceNetwork"/> + <ref name="diskSourceBlock"/> + <ref name="diskSourceVolume"/> + </choice> + <ref name="diskSpecsExtra"/> + </interleave> + </group> + </choice> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="snapshot"/> + </optional> + </element> + </define> + + <define name="diskSpecsExtra"> + <interleave> + <ref name="storageSourceExtra"/> + <ref name="diskBackingChain"/> + <ref name="privateDataDeviceDisk"/> + </interleave> + </define> + + <define name="diskBackingChain"> + <choice> + <ref name="diskBackingStore"/> + <ref name="diskBackingStoreLast"/> + </choice> + </define> + + <define name="diskBackingStore"> + <element name="backingStore"> + <optional> + <attribute name="index"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <interleave> + <ref name="diskSource"/> + <ref name="diskBackingChain"/> + <ref name="diskFormat"/> + </interleave> + </element> + </define> + + <define name="diskFormat"> + <element name="format"> + <attribute name="type"> + <ref name="storageFormat"/> + </attribute> + <optional> + <element name="metadata_cache"> + <optional> + <element name="max_size"> + <ref name="scaledInteger"/> + </element> + </optional> + </element> + </optional> + </element> + </define> + + <define name="diskBackingStoreLast"> + <optional> + <element name="backingStore"> + <empty/> + </element> + </optional> + </define> + + <define name="diskSourceSlice"> + <attribute name="offset"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="size"> + <ref name="positiveInteger"/> + </attribute> + </define> + + <define name="diskSourceCommon"> + <optional> + <attribute name="index"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <element name="slices"> + <element name="slice"> + <attribute name="type"> + <value>storage</value> + </attribute> + <ref name="diskSourceSlice"/> + </element> + </element> + </optional> + <ref name="privateDataStorageSource"/> + </define> + + <define name="diskSource"> + <choice> + <ref name="diskSourceFile"/> + <ref name="diskSourceBlock"/> + <ref name="diskSourceDir"/> + <ref name="diskSourceNetwork"/> + <ref name="diskSourceVolume"/> + <ref name="diskSourceNvme"/> + <ref name="diskSourceVhostUser"/> + <ref name="diskSourceVhostVdpa"/> + </choice> + </define> + + <define name="diskSourceFile"> + <optional> + <attribute name="type"> + <value>file</value> + </attribute> + </optional> + <optional> + <element name="source"> + <interleave> + <optional> + <attribute name="file"> + <choice> + <ref name="absFilePath"/> + <ref name="vmwarePath"/> + </choice> + </attribute> + <optional> + <attribute name="fdgroup"/> + </optional> + </optional> + <ref name="diskSourceCommon"/> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + </interleave> + </element> + </optional> + </define> + + <define name="diskSourceBlock"> + <attribute name="type"> + <value>block</value> + </attribute> + <optional> + <element name="source"> + <interleave> + <optional> + <attribute name="dev"> + <choice> + <ref name="absFilePath"/> + <ref name="deviceName"/> + </choice> + </attribute> + </optional> + <ref name="diskSourceCommon"/> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="reservations"/> + </optional> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + </interleave> + </element> + </optional> + </define> + + <define name="diskSourceDir"> + <attribute name="type"> + <value>dir</value> + </attribute> + <optional> + <element name="source"> + <interleave> + <attribute name="dir"> + <ref name="absFilePath"/> + </attribute> + <ref name="diskSourceCommon"/> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <empty/> + </interleave> + </element> + </optional> + </define> + + <define name="diskSourceNetworkHost"> + <element name="host"> + <choice> + <group> + <optional> + <attribute name="transport"> + <choice> + <value>tcp</value> + <value>rdma</value> + </choice> + </attribute> + </optional> + <attribute name="name"> + <choice> + <ref name="dnsName"/> + <ref name="ipAddr"/> + </choice> + </attribute> + <optional> + <attribute name="port"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + <group> + <attribute name="transport"> + <value>unix</value> + </attribute> + <attribute name="socket"> + <ref name="absFilePath"/> + </attribute> + </group> + </choice> + </element> + </define> + + <define name="diskSourceNetworkNFS"> + <element name="identity"> + <optional> + <attribute name="user"> + <ref name="genericName"/> + </attribute> + </optional> + <optional> + <attribute name="group"> + <ref name="genericName"/> + </attribute> + </optional> + </element> + </define> + + <define name="diskSourceNetworkProtocolRBD"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <value>rbd</value> + </attribute> + <ref name="diskSourceCommon"/> + <optional> + <attribute name="name"/> + </optional> + <zeroOrMore> + <ref name="diskSourceNetworkHost"/> + </zeroOrMore> + <optional> + <element name="snapshot"> + <attribute name="name"> + <ref name="genericName"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="config"> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <ref name="diskAuth"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <empty/> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolISCSI"> + <element name="source"> + <attribute name="protocol"> + <value>iscsi</value> + </attribute> + <attribute name="name"/> + <interleave> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="diskAuth"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="initiatorinfo"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolPropsCommon"> + <interleave> + <optional> + <element name="readahead"> + <attribute name="size"> + <ref name="positiveInteger"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="timeout"> + <attribute name="seconds"> + <ref name="positiveInteger"/> + </attribute> + <empty/> + </element> + </optional> + </interleave> + </define> + + <define name="diskSourceNetworkProtocolSSLVerify"> + <element name="ssl"> + <attribute name="verify"> + <ref name="virYesNo"/> + </attribute> + <empty/> + </element> + </define> + + <define name="diskSourceNetworkProtocolHTTPCookies"> + <element name="cookies"> + <oneOrMore> + <element name="cookie"> + <attribute name="name"> + <data type="string"> + <param name="pattern">[!#$%&'*+\-.0-9A-Z\^_`a-z|~]+</param> + </data> + </attribute> + <data type="string"> + <param name="pattern">"?[!#$%&'()*+\-./0-9:>=<?@A-Z\^_`\[\]a-z|~]+"?</param> + </data> + </element> + </oneOrMore> + <empty/> + </element> + </define> + + <define name="diskSourceNetworkProtocolHTTPS"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>https</value> + </choice> + </attribute> + <attribute name="name"/> + <optional> + <attribute name="query"/> + </optional> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="diskSourceNetworkProtocolSSLVerify"/> + </optional> + <optional> + <ref name="diskSourceNetworkProtocolHTTPCookies"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + <optional> + <ref name="diskAuth"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolHTTP"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>http</value> + </choice> + </attribute> + <attribute name="name"/> + <optional> + <attribute name="query"/> + </optional> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="diskSourceNetworkProtocolHTTPCookies"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + <optional> + <ref name="diskAuth"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolFTPS"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>ftps</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="diskSourceNetworkProtocolSSLVerify"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + <optional> + <ref name="diskAuth"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolFTP"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>ftp</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + <optional> + <ref name="diskAuth"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolSSHHostVerify"> + <element name="knownHosts"> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + </element> + </define> + + <define name="diskSourceNetworkProtocolSSHKeyDef"> + <element name="identity"> + <interleave> + <attribute name="username"> + <ref name="genericName"/> + </attribute> + <choice> + <attribute name="keyfile"> + <ref name="absFilePath"/> + </attribute> + <attribute name="agentsock"> + <ref name="absFilePath"/> + </attribute> + </choice> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolSSH"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>ssh</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + <optional> + <ref name="diskSourceNetworkProtocolSSHHostVerify"/> + </optional> + <optional> + <choice> + <ref name="diskSourceNetworkProtocolSSHKeyDef"/> + <ref name="diskAuth"/> + </choice> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolSimple"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>sheepdog</value> + <value>tftp</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="encryption"/> + </optional> + <ref name="diskSourceNetworkProtocolPropsCommon"/> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolNBD"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <value>nbd</value> + </attribute> + <optional> + <attribute name="name"/> + </optional> + <optional> + <attribute name="tls"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="tlsHostname"/> + </optional> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <optional> + <ref name="reconnect"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolGluster"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <value>gluster</value> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <oneOrMore> + <ref name="diskSourceNetworkHost"/> + </oneOrMore> + <optional> + <ref name="encryption"/> + </optional> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolVxHS"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>vxhs</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <optional> + <attribute name="tls"> + <ref name="virYesNo"/> + </attribute> + </optional> + <ref name="diskSourceNetworkHost"/> + </interleave> + </element> + </define> + + <define name="diskSourceNetworkProtocolNFS"> + <element name="source"> + <interleave> + <attribute name="protocol"> + <choice> + <value>nfs</value> + </choice> + </attribute> + <attribute name="name"/> + <ref name="diskSourceCommon"/> + <ref name="diskSourceNetworkHost"/> + <ref name="diskSourceNetworkNFS"/> + </interleave> + </element> + </define> + + <define name="diskSourceNetwork"> + <attribute name="type"> + <value>network</value> + </attribute> + <choice> + <ref name="diskSourceNetworkProtocolNBD"/> + <ref name="diskSourceNetworkProtocolGluster"/> + <ref name="diskSourceNetworkProtocolRBD"/> + <ref name="diskSourceNetworkProtocolISCSI"/> + <ref name="diskSourceNetworkProtocolHTTP"/> + <ref name="diskSourceNetworkProtocolHTTPS"/> + <ref name="diskSourceNetworkProtocolFTPS"/> + <ref name="diskSourceNetworkProtocolFTP"/> + <ref name="diskSourceNetworkProtocolSSH"/> + <ref name="diskSourceNetworkProtocolSimple"/> + <ref name="diskSourceNetworkProtocolVxHS"/> + <ref name="diskSourceNetworkProtocolNFS"/> + </choice> + </define> + + <define name="diskSourceVolume"> + <attribute name="type"> + <value>volume</value> + </attribute> + <optional> + <element name="source"> + <interleave> + <attribute name="pool"> + <ref name="objectName"/> + </attribute> + <attribute name="volume"> + <ref name="volName"/> + </attribute> + <optional> + <attribute name="mode"> + <choice> + <value>host</value> + <value>direct</value> + </choice> + </attribute> + </optional> + <ref name="diskSourceCommon"/> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + </interleave> + </element> + </optional> + </define> + + <define name="diskSourceNvme"> + <attribute name="type"> + <value>nvme</value> + </attribute> + <optional> + <element name="source"> + <interleave> + <attribute name="type"> + <value>pci</value> + </attribute> + <attribute name="namespace"> + <ref name="uint32"/> + </attribute> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <element name="address"> + <ref name="pciaddress"/> + </element> + <ref name="diskSourceCommon"/> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + </interleave> + </element> + </optional> + </define> + + <define name="diskSourceVhostUser"> + <attribute name="type"> + <value>vhostuser</value> + </attribute> + <element name="source"> + <attribute name="type"> + <value>unix</value> + </attribute> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + <optional> + <ref name="reconnect"/> + </optional> + <empty/> + </element> + </define> + + <define name="diskSourceVhostVdpa"> + <attribute name="type"> + <value>vhostvdpa</value> + </attribute> + <element name="source"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <empty/> + </element> + </define> + + <define name="diskTargetDev"> + <data type="string"> + <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param> + </data> + </define> + + <define name="diskTarget"> + <element name="target"> + <attribute name="dev"> + <ref name="diskTargetDev"/> + </attribute> + <optional> + <attribute name="bus"> + <choice> + <value>ide</value> + <value>fdc</value> + <value>scsi</value> + <value>virtio</value> + <value>xen</value> + <value>usb</value> + <value>uml</value> <!-- NOT USED ANYMORE --> + <value>sata</value> + <value>sd</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="tray"> + <choice> + <value>open</value> + <value>closed</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="removable"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="rotation_rate"> + <ref name="positiveInteger"/> + </attribute> + </optional> + </element> + </define> + <define name="geometry"> + <element name="geometry"> + <attribute name="cyls"> + <data type="integer"/> + </attribute> + <attribute name="heads"> + <data type="integer"/> + </attribute> + <attribute name="secs"> + <data type="integer"/> + </attribute> + <optional> + <attribute name="trans"> + <choice> + <value>auto</value> + <value>none</value> + <value>lba</value> + </choice> + </attribute> + </optional> + </element> + </define> + <define name="diskBlockIo"> + <element name="blockio"> + <optional> + <attribute name="logical_block_size"> + <data type="integer"/> + </attribute> + </optional> + <optional> + <attribute name="physical_block_size"> + <data type="integer"/> + </attribute> + </optional> + <optional> + <attribute name="discard_granularity"> + <data type="integer"/> + </attribute> + </optional> + </element> + </define> + + <define name="diskDriverIothreads"> + <element name="iothreads"> + <oneOrMore> + <element name="iothread"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + <zeroOrMore> + <element name="queue"> + <attribute name="id"> + <ref name="unsignedInt"/> + </attribute> + </element> + </zeroOrMore> + </element> + </oneOrMore> + </element> + </define> + + <define name="diskDriver"> + <element name="driver"> + <optional> + <ref name="driverFormat"/> + </optional> + <optional> + <ref name="driverCache"/> + </optional> + <optional> + <ref name="driverErrorPolicy"/> + </optional> + <optional> + <ref name="driverRerrorPolicy"/> + </optional> + <optional> + <ref name="driverIO"/> + </optional> + <optional> + <ref name="ioeventfd"/> + </optional> + <optional> + <ref name="event_idx"/> + </optional> + <optional> + <ref name="copy_on_read"/> + </optional> + <optional> + <ref name="discard"/> + </optional> + <optional> + <ref name="driverIOThread"/> + </optional> + <optional> + <ref name="detect_zeroes"/> + </optional> + <optional> + <attribute name="discard_no_unref"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="queues"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <attribute name="queue_size"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <ref name="virtioOptions"/> + <interleave> + <optional> + <element name="metadata_cache"> + <optional> + <element name="max_size"> + <ref name="scaledInteger"/> + </element> + </optional> + </element> + </optional> + <optional> + <ref name="diskDriverIothreads"/> + </optional> + </interleave> + </element> + </define> + + <define name="driverFormat"> + <optional> + <attribute name="name"> + <ref name="genericName"/> + </attribute> + </optional> + <optional> + <attribute name="type"> + <choice> + <ref name="storageFormat"/> + <value>aio</value> <!-- back-compat for "raw" --> + </choice> + </attribute> + </optional> + </define> + + <define name="driverCache"> + <attribute name="cache"> + <choice> + <value>default</value> + <value>none</value> + <value>writeback</value> + <value>writethrough</value> + <value>directsync</value> + <value>unsafe</value> + </choice> + </attribute> + </define> + <define name="driverErrorPolicy"> + <attribute name="error_policy"> + <choice> + <value>stop</value> + <value>report</value> + <value>ignore</value> + <value>enospace</value> + </choice> + </attribute> + </define> + <define name="driverRerrorPolicy"> + <attribute name="rerror_policy"> + <choice> + <value>stop</value> + <value>report</value> + <value>ignore</value> + </choice> + </attribute> + </define> + <define name="driverIO"> + <attribute name="io"> + <choice> + <value>threads</value> + <value>native</value> + <value>io_uring</value> + </choice> + </attribute> + </define> + <define name="ioeventfd"> + <attribute name="ioeventfd"> + <ref name="virOnOff"/> + </attribute> + </define> + <define name="event_idx"> + <attribute name="event_idx"> + <ref name="virOnOff"/> + </attribute> + </define> + <define name="copy_on_read"> + <attribute name="copy_on_read"> + <ref name="virOnOff"/> + </attribute> + </define> + <define name="discard"> + <attribute name="discard"> + <choice> + <value>unmap</value> + <value>ignore</value> + </choice> + </attribute> + </define> + <define name="driverIOThread"> + <attribute name="iothread"> + <ref name="unsignedInt"/> + </attribute> + </define> + <define name="detect_zeroes"> + <attribute name="detect_zeroes"> + <choice> + <value>off</value> + <value>on</value> + <value>unmap</value> + </choice> + </attribute> + </define> + <define name="controller"> + <element name="controller"> + <optional> + <attribute name="index"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <choice> + <!-- fdc/sata/ccid have only the common attributes --> + <group> + <attribute name="type"> + <choice> + <value>fdc</value> + <value>sata</value> + <value>ccid</value> + </choice> + </attribute> + </group> + <!-- scsi has an optional attribute "model" --> + <group> + <attribute name="type"> + <value>scsi</value> + </attribute> + <optional> + <attribute name="model"> + <choice> + <value>auto</value> + <value>buslogic</value> + <value>lsilogic</value> + <value>lsisas1068</value> + <value>vmpvscsi</value> + <value>ibmvscsi</value> + <value>virtio-scsi</value> + <value>lsisas1078</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + <value>ncr53c90</value> + <value>dc390</value> + <value>am53c974</value> + </choice> + </attribute> + </optional> + </group> + <!-- usb has an optional attribute "model", + and optional subelements "master" and "ports" --> + <group> + <attribute name="type"> + <value>usb</value> + </attribute> + <optional> + <attribute name="model"> + <choice> + <value>piix3-uhci</value> + <value>piix4-uhci</value> + <value>ehci</value> + <value>ich9-ehci1</value> + <value>ich9-uhci1</value> + <value>ich9-uhci2</value> + <value>ich9-uhci3</value> + <value>vt82c686b-uhci</value> + <value>pci-ohci</value> + <value>nec-xhci</value> + <value>none</value> + <value>qusb1</value> + <value>qusb2</value> + <value>qemu-xhci</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="usbmaster"/> + </optional> + <optional> + <attribute name="ports"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + <!-- ide has an optional attribute "model" --> + <group> + <attribute name="type"> + <value>ide</value> + </attribute> + <optional> + <attribute name="model"> + <choice> + <value>piix3</value> + <value>piix4</value> + <value>ich6</value> + </choice> + </attribute> + </optional> + </group> + <!-- isa --> + <group> + <attribute name="type"> + <value>isa</value> + </attribute> + </group> + <!-- pci has an optional attribute "model" --> + <group> + <attribute name="type"> + <value>pci</value> + </attribute> + <interleave> + <optional> + <element name="model"> + <attribute name="name"> + <choice> + <!-- implementations of "pci-root" --> + <value>spapr-pci-host-bridge</value> + <!-- implementations of "pci-bridge" --> + <value>pci-bridge</value> + <!-- implementations of "dmi-to-pci-bridge" --> + <value>i82801b11-bridge</value> + <!-- implementations of "pcie-to-pci-bridge" --> + <value>pcie-pci-bridge</value> + <!-- implementations of "pcie-root-port" --> + <value>ioh3420</value> + <value>pcie-root-port</value> + <!-- implementations of "pcie-switch-upstream-port" --> + <value>x3130-upstream</value> + <!-- implementations of "pcie-switch-downstream-port" --> + <value>xio3130-downstream</value> + <!-- implementations of "pci-expander-bus" --> + <value>pxb</value> + <!-- implementations of "pcie-expander-bus" --> + <value>pxb-pcie</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="target"> + <optional> + <attribute name="chassisNr"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="chassis"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="port"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="busNr"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="index"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="hotplug"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <element name="node"> + <ref name="unsignedInt"/> + </element> + </optional> + <optional> + <attribute name="memReserve"> + <ref name="unsignedLong"/> + </attribute> + </optional> + </element> + </optional> + <!-- *-root controllers have an optional element "pcihole64"--> + <choice> + <group> + <attribute name="model"> + <choice> + <value>pci-root</value> + <value>pcie-root</value> + </choice> + </attribute> + <optional> + <element name="pcihole64"> + <ref name="scaledInteger"/> + </element> + </optional> + </group> + <group> + <attribute name="model"> + <choice> + <value>pci-bridge</value> + <value>dmi-to-pci-bridge</value> + <value>pcie-to-pci-bridge</value> + <value>pcie-root-port</value> + <value>pcie-switch-upstream-port</value> + <value>pcie-switch-downstream-port</value> + <value>pci-expander-bus</value> + <value>pcie-expander-bus</value> + </choice> + </attribute> + </group> + </choice> + </interleave> + </group> + <!-- virtio-serial has optional "ports" and "vectors" --> + <group> + <attribute name="type"> + <value>virtio-serial</value> + </attribute> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="ports"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="vectors"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + <!-- xenbus has an optional attribute "maxGrantFrames" --> + <group> + <attribute name="type"> + <value>xenbus</value> + </attribute> + <optional> + <attribute name="maxGrantFrames"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="maxEventChannels"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + </choice> + <optional> + <element name="driver"> + <optional> + <attribute name="queues"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="cmd_per_lun"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="max_sectors"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <ref name="ioeventfd"/> + </optional> + <optional> + <ref name="driverIOThread"/> + </optional> + <ref name="virtioOptions"/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="filesystemCommon"> + <interleave> + <element name="target"> + <attribute name="dir"/> + <empty/> + </element> + <optional> + <attribute name="accessmode"> + <choice> + <value>passthrough</value> + <value>mapped</value> + <value>squash</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="multidevs"> + <choice> + <value>default</value> + <value>remap</value> + <value>forbid</value> + <value>warn</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="fmode"> + <ref name="createMode"/> + </attribute> + </optional> + <optional> + <attribute name="dmode"> + <ref name="createMode"/> + </attribute> + </optional> + <optional> + <element name="readonly"> + <empty/> + </element> + </optional> + <optional> + <ref name="deviceBoot"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <element name="space_hard_limit"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="space_soft_limit"> + <ref name="scaledInteger"/> + </element> + </optional> + </interleave> + </define> + + <define name="filesystem"> + <element name="filesystem"> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <choice> + <group> + <attribute name="type"> + <value>file</value> + </attribute> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <element name="source"> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <empty/> + </element> + <ref name="filesystemCommon"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>block</value> + </attribute> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <element name="source"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <empty/> + </element> + <ref name="filesystemCommon"/> + </interleave> + </group> + <group> + <!-- type="mount" is default --> + <optional> + <attribute name="type"> + <value>mount</value> + </attribute> + </optional> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <optional> + <ref name="fsBinary"/> + </optional> + <element name="source"> + <choice> + <group> + <attribute name="dir"> + <ref name="absDirPath"/> + </attribute> + </group> + <group> + <attribute name="socket"> + <ref name="absFilePath"/> + </attribute> + </group> + </choice> + <empty/> + </element> + <optional> + <ref name="idmap"/> + </optional> + <ref name="filesystemCommon"/> + </interleave> + </group> + <group> + <optional> + <attribute name="type"> + <value>bind</value> + </attribute> + </optional> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <element name="source"> + <attribute name="dir"> + <ref name="absDirPath"/> + </attribute> + <empty/> + </element> + <ref name="filesystemCommon"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>template</value> + </attribute> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <element name="source"> + <attribute name="name"> + <ref name="genericName"/> + </attribute> + <empty/> + </element> + <ref name="filesystemCommon"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>ram</value> + </attribute> + <interleave> + <optional> + <ref name="fsDriver"/> + </optional> + <element name="source"> + <attribute name="usage"> + <ref name="unsignedLong"/> + </attribute> + <optional> + <attribute name="units"> + <ref name="unit"/> + </attribute> + </optional> + <empty/> + </element> + <ref name="filesystemCommon"/> + </interleave> + </group> + </choice> + </element> + </define> + + <define name="fsDriver"> + <element name="driver"> + <!-- Annoying inconsistency. "disk" uses "name" + for this kind of info, and "type" for the + storage format. We need the latter too, so + had to invent a new attribute name --> + <choice> + <group> + <optional> + <attribute name="type"> + <choice> + <value>path</value> + <value>handle</value> + <value>loop</value> + <value>nbd</value> + <value>ploop</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="format"> + <ref name="storageFormat"/> + </attribute> + </optional> + <optional> + <attribute name="wrpolicy"> + <value>immediate</value> + </attribute> + </optional> + <ref name="virtioOptions"/> + </group> + <group> + <attribute name="type"> + <value>virtiofs</value> + </attribute> + <optional> + <attribute name="queue"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <ref name="virtioOptions"/> + </group> + <group> + <attribute name="type"> + <value>mtp</value> + </attribute> + </group> + <empty/> + </choice> + </element> + </define> + <define name="fsBinary"> + <element name="binary"> + <optional> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + </optional> + <optional> + <attribute name="xattr"> + <ref name="virOnOff"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="cache"> + <optional> + <attribute name="mode"> + <choice> + <value>none</value> + <value>always</value> + </choice> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="sandbox"> + <optional> + <attribute name="mode"> + <choice> + <value>namespace</value> + <value>chroot</value> + </choice> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="lock"> + <optional> + <attribute name="posix"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="flock"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="thread_pool"> + <optional> + <attribute name="size"> + <data type="integer"/> + </attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="interface-network-attributes"> + <attribute name="network"> + <text/> + </attribute> + <optional> + <attribute name="portgroup"> + <ref name="deviceName"/> + </attribute> + </optional> + <optional> + <attribute name="portid"> + <ref name="UUID"/> + </attribute> + </optional> + </define> + + <define name="interface-bridge-attributes"> + <attribute name="bridge"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.\-\\:/ ]*</param> + </data> + </attribute> + <optional> + <attribute name="macTableManager"> + <ref name="macTableManager"/> + </attribute> + </optional> + </define> + + <!-- + An interface description can either be of type bridge in which case + it will use a bridging source, or of type ethernet which uses a device + source and a device target instead. They both share a set of interface + options. FIXME + --> + <define name="interface"> + <element name="interface"> + <choice> + <group> + <attribute name="type"> + <value>bridge</value> + </attribute> + <interleave> + <optional> + <element name="source"> + <ref name="interface-bridge-attributes"/> + <optional> + <ref name="interface-network-attributes"/> + </optional> + <empty/> + </element> + </optional> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>ethernet</value> + </attribute> + <interleave> + <optional> + <element name="source"> + <ref name="interface-ip-info"/> + </element> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>vhostuser</value> + </attribute> + <interleave> + <ref name="unixSocketSource"/> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>network</value> + </attribute> + <interleave> + <element name="source"> + <ref name="interface-network-attributes"/> + <optional> + <ref name="interface-bridge-attributes"/> + </optional> + <empty/> + </element> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>direct</value> + </attribute> + <interleave> + <element name="source"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="mode"> + <ref name="bridgeMode"/> + </attribute> + </optional> + <optional> + <ref name="interface-network-attributes"/> + </optional> + <empty/> + </element> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>user</value> + </attribute> + <interleave> + <optional> + <element name="source"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + <empty/> + </element> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>internal</value> + </attribute> + <interleave> + <element name="source"> + <attribute name="name"> + <ref name="deviceName"/> + </attribute> + <empty/> + </element> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <choice> + <value>mcast</value> + <value>client</value> + </choice> + </attribute> + <interleave> + <element name="source"> + <attribute name="address"> + <ref name="ipv4Addr"/> + </attribute> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + <empty/> + </element> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>udp</value> + </attribute> + <interleave> + <element name="source"> + <attribute name="address"> + <ref name="ipv4Addr"/> + </attribute> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + <element name="local"> + <attribute name="address"> + <ref name="ipv4Addr"/> + </attribute> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + <empty/> + </element> + </element> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>server</value> + </attribute> + <interleave> + <element name="source"> + <optional> + <attribute name="address"> + <ref name="ipv4Addr"/> + </attribute> + </optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + <empty/> + </element> + <ref name="interface-options"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>hostdev</value> + </attribute> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <element name="source"> + <optional> + <attribute name="missing"> + <ref name="virYesNo"/> + </attribute> + </optional> + <choice> + <group> + <ref name="usbproduct"/> + <optional> + <ref name="usbaddress"/> + </optional> + </group> + <element name="address"> + <choice> + <group> + <attribute name="type"> + <value>pci</value> + </attribute> + <ref name="pciaddress"/> + </group> + <group> + <attribute name="type"> + <value>usb</value> + </attribute> + <attribute name="bus"> + <ref name="usbAddr"/> + </attribute> + <attribute name="device"> + <ref name="usbAddr"/> + </attribute> + </group> + </choice> + </element> + </choice> + </element> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <ref name="interface-options"/> + </interleave> + </group> + + <group> + <attribute name="type"> + <value>vdpa</value> + </attribute> + <interleave> + <element name="source"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </element> + <ref name="interface-options"/> + </interleave> + </group> + + <group> + <attribute name="type"> + <value>null</value> + </attribute> + <ref name="interface-options"/> + </group> + + <group> + <attribute name="type"> + <value>vds</value> + </attribute> + <interleave> + <element name="source"> + <attribute name="switchid"> + <ref name="UUID"/> + </attribute> + <attribute name="portid"> + <data type="long"/> + </attribute> + <attribute name="portgroupid"> + <data type="string"/> + </attribute> + <attribute name="connectionid"> + <data type="long"/> + </attribute> + </element> + <ref name="interface-options"/> + </interleave> + </group> + + </choice> + <optional> + <attribute name="trustGuestRxFilters"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </define> + <!-- + The interface options possible are: + - the MAC address + - the IP address bound to the interface + - the name of the script used to set up the binding + - the target device used + - boot order + - link state + --> + <define name="interface-options"> + <interleave> + <optional> + <element name="link"> + <attribute name="state"> + <choice> + <value>up</value> + <value>down</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <ref name="mtu"/> + </optional> + <optional> + <ref name="coalesce"/> + </optional> + <optional> + <element name="target"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <empty/> + </element> + </optional> + <optional> + <element name="guest"> + <interleave> + <optional> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </optional> + <optional> + <attribute name="actual"> + <ref name="deviceName"/> + </attribute> + </optional> + </interleave> + <empty/> + </element> + </optional> + <optional> + <element name="mac"> + <attribute name="address"> + <ref name="uniMacAddr"/> + </attribute> + <optional> + <attribute name="type"> + <choice> + <value>generated</value> + <value>static</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="check"> + <ref name="virYesNo"/> + </attribute> + </optional> + <empty/> + </element> + </optional> + <ref name="interface-ip-info"/> + <ref name="interface-port-forwards"/> + <optional> + <element name="script"> + <attribute name="path"> + <ref name="filePath"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="downscript"> + <attribute name="path"> + <ref name="filePath"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="backenddomain"> + <attribute name="name"> + <ref name="objectNameWithSlash"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="model"> + <attribute name="type"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9\-_]+</param> + </data> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="backend"> + <optional> + <attribute name="type"> + <choice> + <value>passt</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="tap"> + <ref name="absFilePath"/> + </attribute> + </optional> + <optional> + <attribute name="vhost"> + <ref name="absFilePath"/> + </attribute> + </optional> + <optional> + <attribute name="logFile"> + <ref name="absFilePath"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <choice> + <group> + <ref name="hostdevDriver"/> + </group> + <group> + <element name="driver"> + <optional> + <attribute name="name"> + <choice> + <value>qemu</value> + <value>vhost</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="queues"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <attribute name="rx_queue_size"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <attribute name="tx_queue_size"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <optional> + <attribute name="txmode"> + <choice> + <value>iothread</value> + <value>timer</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="ioeventfd"/> + </optional> + <optional> + <ref name="event_idx"/> + </optional> + <ref name="virtioOptions"/> + <interleave> + <optional> + <element name="host"> + <optional> + <attribute name="csum"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="gso"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="tso4"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="tso6"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="ecn"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="ufo"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="mrg_rxbuf"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="guest"> + <optional> + <attribute name="csum"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="tso4"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="tso6"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="ecn"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="ufo"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <attribute name="rss"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="rss_hash_report"> + <ref name="virOnOff"/> + </attribute> + </optional> + </interleave> + </element> + </group> + </choice> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <element name="filterref"> + <ref name="filterref-node-attributes"/> + </element> + </optional> + <optional> + <element name="tune"> + <optional> + <!-- size of send buffer for network tap devices --> + <element name="sndbuf"> + <ref name="unsignedInt"/> + </element> + </optional> + </element> + </optional> + <optional> + <ref name="deviceBoot"/> + </optional> + <optional> + <ref name="rom"/> + </optional> + <optional> + <ref name="bandwidth"/> + </optional> + <optional> + <ref name="vlan"/> + </optional> + <optional> + <ref name="portOptions"/> + </optional> + <optional> + <ref name="teaming"/> + </optional> + </interleave> + </define> + + <!-- + All ip-related info for either the host or guest side of an interface + --> + <define name="interface-ip-info"> + <interleave> + <zeroOrMore> + <element name="ip"> + <attribute name="address"> + <ref name="ipAddr"/> + </attribute> + <optional> + <attribute name="family"> + <ref name="addr-family"/> + </attribute> + </optional> + <optional> + <attribute name="prefix"> + <ref name="ipPrefix"/> + </attribute> + </optional> + <optional> + <attribute name="peer"> + <ref name="ipAddr"/> + </attribute> + </optional> + <empty/> + </element> + </zeroOrMore> + <zeroOrMore> + <ref name="route"/> + </zeroOrMore> + </interleave> + </define> + + <define name="interface-port-forwards"> + <zeroOrMore> + <element name="portForward"> + <attribute name="proto"> + <choice> + <value>tcp</value> + <value>udp</value> + </choice> + </attribute> + <optional> + <attribute name="address"> + <ref name="ipAddr"/> + </attribute> + </optional> + <optional> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </optional> + <interleave> + <zeroOrMore> + <element name="range"> + <attribute name="start"> + <ref name="PortNumber"/> + </attribute> + <optional> + <attribute name="end"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="to"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="exclude"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </zeroOrMore> + </interleave> + </element> + </zeroOrMore> + </define> + + <define name="teaming"> + <element name="teaming"> + <choice> + <group> + <attribute name="type"> + <value>persistent</value> + </attribute> + </group> + <group> + <attribute name="type"> + <value>transient</value> + </attribute> + <attribute name="persistent"> + <ref name="aliasName"/> + </attribute> + </group> + </choice> + </element> + </define> + + <!-- + An emulator description is just a path to the binary used for the task + --> + <define name="emulator"> + <element name="emulator"> + <ref name="absFilePath"/> + </element> + </define> + <!-- + A graphic description (SPICE, VNC, SDL, ...) + --> + <define name="graphic"> + <element name="graphics"> + <choice> + <group> + <attribute name="type"> + <value>sdl</value> + </attribute> + <optional> + <attribute name="display"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="xauth"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="fullscreen"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <element name="gl"> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + <empty/> + </element> + </optional> + </group> + <group> + <attribute name="type"> + <value>vnc</value> + </attribute> + <choice> + <group> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="autoport"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="websocket"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="listen"> + <ref name="addrIPorName"/> + </attribute> + </optional> + <optional> + <attribute name="sharePolicy"> + <choice> + <value>allow-exclusive</value> + <value>force-shared</value> + <value>ignore</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="powerControl"> + <ref name="virYesNo"/> + </attribute> + </optional> + </group> + <group> + <optional> + <attribute name="socket"> + <ref name="absFilePath"/> + </attribute> + </optional> + </group> + </choice> + <optional> + <attribute name="passwd"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="keymap"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="passwdValidTo"> + <data type="dateTime"/> + </attribute> + </optional> + <optional> + <attribute name="connected"> + <value>keep</value> + </attribute> + </optional> + <interleave> + <optional> + <element name="audio"> + <attribute name="id"> + <ref name="uint8"/> + </attribute> + </element> + </optional> + <ref name="listenElements"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>spice</value> + </attribute> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="tlsPort"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="autoport"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="listen"> + <ref name="addrIPorName"/> + </attribute> + </optional> + <optional> + <attribute name="passwd"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="keymap"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="passwdValidTo"> + <data type="dateTime"/> + </attribute> + </optional> + <optional> + <attribute name="connected"> + <choice> + <value>fail</value> + <value>disconnect</value> + <value>keep</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="defaultMode"> + <choice> + <value>any</value> + <value>secure</value> + <value>insecure</value> + </choice> + </attribute> + </optional> + <interleave> + <ref name="listenElements"/> + <zeroOrMore> + <element name="channel"> + <attribute name="name"> + <choice> + <value>main</value> + <value>display</value> + <value>inputs</value> + <value>cursor</value> + <value>playback</value> + <value>record</value> + <value>smartcard</value> + <value>usbredir</value> + </choice> + </attribute> + <attribute name="mode"> + <choice> + <value>any</value> + <value>secure</value> + <value>insecure</value> + </choice> + </attribute> + <empty/> + </element> + </zeroOrMore> + <optional> + <element name="image"> + <attribute name="compression"> + <choice> + <value>auto_glz</value> + <value>auto_lz</value> + <value>quic</value> + <value>glz</value> + <value>lz</value> + <value>off</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="jpeg"> + <attribute name="compression"> + <choice> + <value>auto</value> + <value>never</value> + <value>always</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="zlib"> + <attribute name="compression"> + <choice> + <value>auto</value> + <value>never</value> + <value>always</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="playback"> + <attribute name="compression"> + <ref name="virOnOff"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="streaming"> + <attribute name="mode"> + <choice> + <value>filter</value> + <value>all</value> + <value>off</value> + </choice> + </attribute> + <empty/> + </element> + </optional> + <optional> + <ref name="clipboard"/> + </optional> + <optional> + <ref name="mousemode"/> + </optional> + <optional> + <element name="filetransfer"> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + <empty/> + </element> + </optional> + <optional> + <element name="gl"> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="rendernode"> + <ref name="absFilePath"/> + </attribute> + </optional> + <empty/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>dbus</value> + </attribute> + <optional> + <choice> + <group> + <attribute name="address"> + <ref name="dbusAddr"/> + </attribute> + </group> + <group> + <attribute name="p2p"> + <ref name="virYesNo"/> + </attribute> + </group> + </choice> + </optional> + <interleave> + <optional> + <element name="gl"> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="rendernode"> + <ref name="absFilePath"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="audio"> + <attribute name="id"> + <ref name="uint8"/> + </attribute> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>rdp</value> + </attribute> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="autoport"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="replaceUser"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="multiUser"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="listen"> + <ref name="addrIPorName"/> + </attribute> + </optional> + <ref name="listenElements"/> + </group> + <group> + <attribute name="type"> + <value>desktop</value> + </attribute> + <optional> + <attribute name="display"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="fullscreen"> + <ref name="virYesNo"/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>egl-headless</value> + </attribute> + <optional> + <element name="gl"> + <optional> + <attribute name="rendernode"> + <ref name="absFilePath"/> + </attribute> + </optional> + </element> + </optional> + </group> + </choice> + </element> + </define> + + <define name="clipboard"> + <element name="clipboard"> + <attribute name="copypaste"> + <ref name="virYesNo"/> + </attribute> + <empty/> + </element> + </define> + <define name="mousemode"> + <element name="mouse"> + <attribute name="mode"> + <choice> + <value>server</value> + <value>client</value> + </choice> + </attribute> + <empty/> + </element> + </define> + <define name="listenElements"> + <zeroOrMore> + <element name="listen"> + <choice> + <group> + <attribute name="type"> + <value>address</value> + </attribute> + <optional> + <attribute name="address"> + <ref name="addrIPorName"/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>network</value> + </attribute> + <attribute name="network"> + <text/> + </attribute> + <optional> + <attribute name="address"> + <ref name="addrIPorName"/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>socket</value> + </attribute> + <optional> + <attribute name="socket"> + <ref name="absFilePath"/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>none</value> + </attribute> + </group> + </choice> + </element> + </zeroOrMore> + </define> + <!-- + A video adapter description, allowing configuration of device + model, number of virtual heads, video ram size, and for qxl + both ram bar sizes. + --> + <define name="video"> + <element name="video"> + <interleave> + <optional> + <element name="driver"> + <optional> + <ref name="virtioOptions"/> + </optional> + <optional> + <attribute name="name"> + <choice> + <value>qemu</value> + <value>vhostuser</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="vgaconf"> + <choice> + <value>io</value> + <value>on</value> + <value>off</value> + </choice> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="model"> + <choice> + <attribute name="type"> + <choice> + <value>vga</value> + <value>cirrus</value> + <value>vmvga</value> + <value>xen</value> + <value>vbox</value> + <value>virtio</value> + <value>gop</value> + <value>none</value> + <value>bochs</value> + <value>ramfb</value> + </choice> + </attribute> + <group> + <attribute name="type"> + <value>qxl</value> + </attribute> + <optional> + <attribute name="ram"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="vgamem"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="vram64"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + </choice> + <optional> + <attribute name="vram"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="heads"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="primary"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="blob"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <element name="acceleration"> + <optional> + <attribute name="accel3d"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="accel2d"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="rendernode"> + <ref name="absFilePath"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="resolution"> + <attribute name="x"> + <ref name="unsignedInt"/> + </attribute> + <attribute name="y"> + <ref name="unsignedInt"/> + </attribute> + </element> + </optional> + </element> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + <!-- + When a certain event happens, multiple policies can be applied + depends on what happened: + --> + <define name="events"> + <interleave> + <optional> + <element name="on_reboot"> + <ref name="offOptions"/> + </element> + </optional> + <optional> + <element name="on_poweroff"> + <ref name="offOptions"/> + </element> + </optional> + <optional> + <element name="on_crash"> + <ref name="crashOptions"/> + </element> + </optional> + <optional> + <element name="on_lockfailure"> + <ref name="lockfailureOptions"/> + </element> + </optional> + </interleave> + </define> + <!-- + Options when a domain terminates: + destroy: The domain is cleaned up + restart: A new domain is started in place of the old one + preserve: The domain will remain in memory until it is destroyed manually + rename-restart: a variant of the previous one but where the old domain is + renamed before being saved to allow a restart + --> + <define name="offOptions"> + <choice> + <value>destroy</value> + <value>restart</value> + <value>preserve</value> + <value>rename-restart</value> + </choice> + </define> + <!-- + Options when a domain crashes: + destroy: The domain is cleaned up + restart: A new domain is started in place of the old one + preserve: The domain will remain in memory until it is destroyed manually + rename-restart: a variant of the previous one but where the old domain is + renamed before being saved to allow a restart + coredump-destroy: The crashed domain's core will be dumped, and then the + domain will be terminated completely and all resources + released + coredump-restart: The crashed domain's core will be dumped, and then the + domain will be restarted with the same configuration + --> + <define name="crashOptions"> + <choice> + <value>destroy</value> + <value>restart</value> + <value>preserve</value> + <value>rename-restart</value> + <value>coredump-destroy</value> + <value>coredump-restart</value> + </choice> + </define> + <!-- + Options when resource locks are lost: + poweroff: power off the domain + restart: power off the domain and start it up again to reacquire the + locks + pause: pause the execution of the domain so that it can be manually + resumed when lock issues are solved + ignore: keep the domain running + --> + <define name="lockfailureOptions"> + <choice> + <value>poweroff</value> + <value>restart</value> + <value>pause</value> + <value>ignore</value> + </choice> + </define> + <!-- + Control ACPI sleep states (dis)allowed for the domain + For each of the states the following rules apply: + on: the state will be forcefully enabled + off: the state will be forcefully disabled + not specified: hypervisor will be left to decide its defaults + --> + <define name="pm"> + <element name="pm"> + <interleave> + <optional> + <element name="suspend-to-mem"> + <ref name="suspendChoices"/> + </element> + </optional> + <optional> + <element name="suspend-to-disk"> + <ref name="suspendChoices"/> + </element> + </optional> + </interleave> + <empty/> + </element> + </define> + <define name="suspendChoices"> + <optional> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + </optional> + </define> + <!-- + Specific setup for a qemu emulated character device. Note: this + definition doesn't fully specify the constraints on this node. + --> + <define name="qemucdev"> + <ref name="qemucdevSrcType"/> + <optional> + <attribute name="tty"> + <ref name="absFilePath"/> + </attribute> + </optional> + <interleave> + <ref name="qemucdevSrcDef"/> + <optional> + <ref name="qemucdevTgtDef"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </define> + + <define name="qemucdevConsoleTgtType"> + <attribute name="type"> + <choice> + <value>xen</value> + <value>serial</value> + <value>uml</value> <!-- NOT USED ANYMORE --> + <value>virtio</value> + <value>lxc</value> + <value>openvz</value> + <value>sclp</value> + <value>sclplm</value> + </choice> + </attribute> + </define> + + <define name="qemucdevSerialTgtType"> + <attribute name="type"> + <choice> + <value>isa-serial</value> + <value>usb-serial</value> + <value>pci-serial</value> + <value>spapr-vio-serial</value> + <value>system-serial</value> + <value>sclp-serial</value> + <value>isa-debug</value> + </choice> + </attribute> + </define> + + <define name="qemucdevSerialTgtModel"> + <element name="model"> + <attribute name="name"> + <choice> + <value>isa-serial</value> + <value>usb-serial</value> + <value>pci-serial</value> + <value>spapr-vty</value> + <value>pl011</value> + <value>16550a</value> + <value>sclpconsole</value> + <value>sclplmconsole</value> + <value>isa-debugcon</value> + </choice> + </attribute> + </element> + </define> + + <define name="qemucdevTgtDef"> + <element name="target"> + <interleave> + <choice> + <optional> + <ref name="qemucdevConsoleTgtType"/> + </optional> + <optional> + <ref name="qemucdevSerialTgtType"/> + </optional> + </choice> + <optional> + <attribute name="port"/> + </optional> + <optional> + <ref name="qemucdevSerialTgtModel"/> + </optional> + </interleave> + </element> + </define> + + <define name="qemucdevSrcTypeChoice"> + <choice> + <value>dev</value> + <value>file</value> + <value>pipe</value> + <value>unix</value> + <value>tcp</value> + <value>udp</value> + <value>null</value> + <value>stdio</value> + <value>vc</value> + <value>pty</value> + <value>spicevmc</value> + <value>spiceport</value> + <value>nmdm</value> + <value>qemu-vdagent</value> + <value>dbus</value> + </choice> + </define> + + <define name="usbdevfilter"> + <element name="usbdev"> + <attribute name="allow"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="class"> + <choice> + <ref name="usbClass"/> + <ref name="usbIdDefault"/> + </choice> + </attribute> + </optional> + <optional> + <attribute name="vendor"> + <choice> + <ref name="usbId"/> + <ref name="usbIdDefault"/> + </choice> + </attribute> + </optional> + <optional> + <attribute name="product"> + <choice> + <ref name="usbId"/> + <ref name="usbIdDefault"/> + </choice> + </attribute> + </optional> + <optional> + <attribute name="version"> + <choice> + <ref name="usbVersion"/> + <ref name="usbIdDefault"/> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="qemucdevSrcType"> + <attribute name="type"> + <ref name="qemucdevSrcTypeChoice"/> + </attribute> + </define> + + <define name="qemucdevSrcDef"> + <interleave> + <zeroOrMore> + <element name="source"> + <optional> + <attribute name="mode"/> + </optional> + <optional> + <attribute name="path"/> + </optional> + <optional> + <attribute name="host"/> + </optional> + <optional> + <attribute name="service"/> + </optional> + <optional> + <attribute name="channel"/> + </optional> + <optional> + <attribute name="master"/> + </optional> + <optional> + <attribute name="slave"/> + </optional> + <optional> + <attribute name="append"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="tls"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <ref name="reconnect"/> + </optional> + <interleave> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="clipboard"/> + </optional> + <optional> + <ref name="mousemode"/> + </optional> + </interleave> + </element> + </zeroOrMore> + <optional> + <element name="protocol"> + <optional> + <attribute name="type"> + <choice> + <value>raw</value> + <value>telnet</value> + <value>telnets</value> + <value>tls</value> + </choice> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="log"> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <optional> + <attribute name="append"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + </interleave> + </define> + <!-- + The description for a console + just a tty device + --> + <define name="console"> + <element name="console"> + <choice> + <group> + <optional> + <attribute name="tty"> + <ref name="absFilePath"/> + </attribute> + </optional> + <empty/> + </group> + <ref name="qemucdev"/> + </choice> + </element> + </define> + <define name="codec"> + <element name="codec"> + <attribute name="type"> + <choice> + <value>duplex</value> + <value>micro</value> + <value>output</value> + </choice> + </attribute> + </element> + </define> + <define name="sound"> + <element name="sound"> + <attribute name="model"> + <choice> + <value>sb16</value> + <value>es1370</value> + <value>pcspk</value> + <value>ac97</value> + <value>ich6</value> + <value>ich7</value> + <value>ich9</value> + <value>usb</value> + </choice> + </attribute> + <optional> + <attribute name="multichannel"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <element name="audio"> + <attribute name="id"> + <ref name="uint8"/> + </attribute> + </element> + </optional> + <zeroOrMore> + <ref name="codec"/> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="audiocommonattr"> + <optional> + <attribute name="mixingEngine"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="fixedSettings"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="voices"> + <ref name="uint32"/> + </attribute> + </optional> + <optional> + <attribute name="bufferLength"> + <ref name="uint32"/> + </attribute> + </optional> + </define> + + <define name="audiocommonchild"> + <optional> + <element name="settings"> + <optional> + <attribute name="frequency"> + <ref name="uint32"/> + </attribute> + </optional> + <optional> + <attribute name="channels"> + <ref name="uint32"/> + </attribute> + </optional> + <optional> + <attribute name="format"> + <choice> + <value>s8</value> + <value>u8</value> + <value>s16</value> + <value>u16</value> + <value>s32</value> + <value>u32</value> + <value>f32</value> + </choice> + </attribute> + </optional> + </element> + </optional> + </define> + + <define name="audionone"> + <ref name="audiocommonattr"/> + <ref name="audiocommonchild"/> + </define> + + <define name="audioalsa"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="dev"> + <ref name="filePath"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiocoreaudio"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="bufferCount"> + <ref name="uint32"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiojack"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="serverName"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="clientName"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="connectPorts"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="exactName"> + <ref name="virYesNo"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiooss"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </optional> + <optional> + <attribute name="bufferCount"> + <ref name="uint32"/> + </attribute> + </optional> + <optional> + <attribute name="tryPoll"> + <ref name="virYesNo"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiopipewire"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="name"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="streamName"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="latency"> + <ref name="uint32"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiopulseaudio"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="name"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="streamName"> + <data type="string"/> + </attribute> + </optional> + <optional> + <attribute name="latency"> + <ref name="uint32"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiosdl"> + <ref name="audiocommonattr"/> + <optional> + <attribute name="bufferCount"> + <ref name="uint32"/> + </attribute> + </optional> + <ref name="audiocommonchild"/> + </define> + + <define name="audiospice"> + <ref name="audiocommonattr"/> + <ref name="audiocommonchild"/> + </define> + + <define name="audiofile"> + <ref name="audiocommonattr"/> + <ref name="audiocommonchild"/> + </define> + + <define name="audiodbus"> + <ref name="audiocommonattr"/> + <ref name="audiocommonchild"/> + </define> + + <define name="audio"> + <element name="audio"> + <attribute name="id"> + <ref name="uint8"/> + </attribute> + <optional> + <attribute name="timerPeriod"> + <ref name="uint32"/> + </attribute> + </optional> + <choice> + <group> + <attribute name="type"> + <value>none</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audionone"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audionone"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>dbus</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audiodbus"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiodbus"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>alsa</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audioalsa"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audioalsa"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>coreaudio</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audiocoreaudio"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiocoreaudio"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>jack</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audiojack"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiojack"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <choice> + <value>oss</value> + </choice> + </attribute> + <optional> + <attribute name="tryMMap"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="exclusive"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="dspPolicy"> + <data type="int"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="input"> + <ref name="audiooss"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiooss"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>pipewire</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audiopipewire"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiopipewire"/> + </element> + </optional> + <optional> + <attribute name="runtimeDir"> + <ref name="filePath"/> + </attribute> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>pulseaudio</value> + </attribute> + <optional> + <attribute name="serverName"> + <data type="string"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="input"> + <ref name="audiopulseaudio"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiopulseaudio"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>sdl</value> + </attribute> + <optional> + <attribute name="driver"> + <choice> + <value>esd</value> + <value>alsa</value> + <value>arts</value> + <value>pulseaudio</value> + </choice> + </attribute> + </optional> + <interleave> + <optional> + <element name="input"> + <ref name="audiosdl"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiosdl"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>spice</value> + </attribute> + <interleave> + <optional> + <element name="input"> + <ref name="audiospice"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiospice"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>file</value> + </attribute> + <optional> + <attribute name="path"> + <ref name="filePath"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="input"> + <ref name="audiofile"/> + </element> + </optional> + <optional> + <element name="output"> + <ref name="audiofile"/> + </element> + </optional> + </interleave> + </group> + </choice> + </element> + </define> + <define name="watchdog"> + <element name="watchdog"> + <interleave> + <attribute name="model"> + <choice> + <value>i6300esb</value> + <value>ib700</value> + <value>diag288</value> + <value>itco</value> + </choice> + </attribute> + <optional> + <attribute name="action"> + <choice> + <value>reset</value> + <value>shutdown</value> + <value>poweroff</value> + <value>pause</value> + <value>none</value> + <value>dump</value> + <value>inject-nmi</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + <define name="nvram"> + <element name="nvram"> + <optional> + <ref name="address"/> + </optional> + </element> + </define> + + <define name="shmem"> + <element name="shmem"> + <attribute name="name"> + <data type="string"> + <param name="pattern">[^/]*</param> + </data> + </attribute> + <optional> + <attribute name="role"> + <choice> + <value>master</value> + <value>peer</value> + </choice> + </attribute> + </optional> + <interleave> + <optional> + <element name="model"> + <attribute name="type"> + <choice> + <value>ivshmem</value> + <value>ivshmem-plain</value> + <value>ivshmem-doorbell</value> + </choice> + </attribute> + </element> + </optional> + <optional> + <element name="size"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="server"> + <optional> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="msi"> + <optional> + <ref name="ioeventfd"/> + </optional> + <optional> + <attribute name="vectors"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="memballoon"> + <element name="memballoon"> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + <value>xen</value> + <value>none</value> + </choice> + </attribute> + <optional> + <attribute name="autodeflate"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="freePageReporting"> + <ref name="virOnOff"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <element name="stats"> + <attribute name="period"> + <ref name="positiveInteger"/> + </attribute> + </element> + </optional> + <optional> + <element name="driver"> + <ref name="virtioOptions"/> + </element> + </optional> + </interleave> + </element> + </define> + <define name="parallel"> + <element name="parallel"> + <ref name="qemucdev"/> + </element> + </define> + <define name="serial"> + <element name="serial"> + <ref name="qemucdev"/> + </element> + </define> + <define name="guestfwdTarget"> + <element name="target"> + <attribute name="type"> + <value>guestfwd</value> + </attribute> + <attribute name="address"/> + <attribute name="port"/> + </element> + </define> + <define name="virtioTarget"> + <element name="target"> + <attribute name="type"> + <value>virtio</value> + </attribute> + <optional> + <attribute name="name"/> + </optional> + <optional> + <attribute name="state"> + <choice> + <value>connected</value> + <value>disconnected</value> + </choice> + </attribute> + </optional> + </element> + </define> + <define name="xenTarget"> + <element name="target"> + <attribute name="type"> + <value>xen</value> + </attribute> + <optional> + <attribute name="name"/> + </optional> + </element> + </define> + <define name="channel"> + <element name="channel"> + <ref name="qemucdevSrcType"/> + <interleave> + <ref name="qemucdevSrcDef"/> + <choice> + <ref name="guestfwdTarget"/> + <ref name="virtioTarget"/> + <ref name="xenTarget"/> + </choice> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="smartcard"> + <element name="smartcard"> + <interleave> + <choice> + <group> + <attribute name="mode"> + <value>host</value> + </attribute> + <!-- might need to add optional database element here later --> + </group> + <group> + <interleave> + <attribute name="mode"> + <value>host-certificates</value> + </attribute> + <group> + <ref name="certificate"/> + <ref name="certificate"/> + <ref name="certificate"/> + </group> + <optional> + <element name="database"> + <ref name="absDirPath"/> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="mode"> + <value>passthrough</value> + </attribute> + <ref name="qemucdevSrcType"/> + <interleave> + <ref name="qemucdevSrcDef"/> + <optional> + <ref name="qemucdevTgtDef"/> + </optional> + </interleave> + </group> + </choice> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="certificate"> + <element name="certificate"> + <text/> + </element> + </define> + + <define name="tpm"> + <element name="tpm"> + <optional> + <attribute name="model"> + <choice> + <value>tpm-tis</value> + <value>tpm-crb</value> + <value>tpm-spapr</value> + <value>spapr-tpm-proxy</value> + </choice> + </attribute> + </optional> + <interleave> + <ref name="tpm-backend"/> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="tpm-backend"> + <element name="backend"> + <choice> + <group> + <attribute name="type"> + <value>passthrough</value> + </attribute> + <ref name="tpm-passthrough-device"/> + </group> + <group> + <attribute name="type"> + <value>emulator</value> + </attribute> + <interleave> + <ref name="tpm-backend-emulator-encryption"/> + <ref name="tpm-backend-emulator-active-pcr-banks"/> + </interleave> + <optional> + <attribute name="persistent_state"> + <ref name="virYesNo"/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>external</value> + </attribute> + <ref name="tpm-external-source"/> + </group> + </choice> + <optional> + <attribute name="version"> + <choice> + <value>1.2</value> + <value>2.0</value> + </choice> + </attribute> + </optional> + </element> + </define> + + <define name="tpm-passthrough-device"> + <optional> + <element name="device"> + <optional> + <attribute name="path"> + <ref name="filePath"/> + </attribute> + </optional> + </element> + </optional> + </define> + + <define name="tpm-external-source"> + <optional> + <element name="source"> + <attribute name="type"> + <value>unix</value> + </attribute> + <attribute name="path"> + <ref name="filePath"/> + </attribute> + <attribute name="mode"> + <value>connect</value> + </attribute> + </element> + </optional> + </define> + + <define name="tpm-backend-emulator-encryption"> + <optional> + <element name="encryption"> + <attribute name="secret"> + <ref name="UUID"/> + </attribute> + </element> + </optional> + </define> + + <define name="tpm-backend-emulator-active-pcr-banks"> + <optional> + <element name="active_pcr_banks"> + <interleave> + <optional> + <element name="sha1"> + <empty/> + </element> + </optional> + <optional> + <element name="sha256"> + <empty/> + </element> + </optional> + <optional> + <element name="sha384"> + <empty/> + </element> + </optional> + <optional> + <element name="sha512"> + <empty/> + </element> + </optional> + </interleave> + </element> + </optional> + </define> + + <define name="vsock"> + <element name="vsock"> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <interleave> + <optional> + <element name="cid"> + <optional> + <attribute name="auto"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="address"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <element name="driver"> + <ref name="virtioOptions"/> + </element> + </optional> + </interleave> + </element> + </define> + <define name="iommu"> + <element name="iommu"> + <attribute name="model"> + <choice> + <value>intel</value> + <value>smmuv3</value> + <value>virtio</value> + </choice> + </attribute> + <interleave> + <optional> + <element name="driver"> + <optional> + <attribute name="intremap"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="caching_mode"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="eim"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="iotlb"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="aw_bits"> + <ref name="uint8"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + </interleave> + </element> + </define> + + <define name="input"> + <element name="input"> + <interleave> + <optional> + <element name="driver"> + <ref name="virtioOptions"/> + </element> + </optional> + <choice> + <group> + <attribute name="type"> + <choice> + <value>tablet</value> + <value>mouse</value> + <value>keyboard</value> + </choice> + </attribute> + <optional> + <attribute name="bus"> + <choice> + <value>ps2</value> + <value>usb</value> + <value>xen</value> + <value>virtio</value> + </choice> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> + <value>passthrough</value> + </attribute> + <attribute name="bus"> + <value>virtio</value> + </attribute> + <element name="source"> + <attribute name="evdev"> + <ref name="absFilePath"/> + </attribute> + </element> + </group> + <group> + <attribute name="type"> + <value>evdev</value> + </attribute> + <element name="source"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <optional> + <attribute name="grab"> + <value>all</value> + </attribute> + </optional> + <optional> + <attribute name="grabToggle"> + <choice> + <value>ctrl-ctrl</value> + <value>alt-alt</value> + <value>shift-shift</value> + <value>meta-meta</value> + <value>scrolllock</value> + <value>ctrl-scrolllock</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="repeat"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </group> + </choice> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + <define name="hub"> + <element name="hub"> + <attribute name="type"> + <value>usb</value> + </attribute> + <interleave> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + <define name="redirdev"> + <element name="redirdev"> + <attribute name="bus"> + <value>usb</value> + </attribute> + <attribute name="type"> + <ref name="qemucdevSrcTypeChoice"/> + </attribute> + <interleave> + <ref name="qemucdevSrcDef"/> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="deviceBoot"/> + </optional> + </interleave> + </element> + </define> + <define name="redirfilter"> + <element name="redirfilter"> + <zeroOrMore> + <ref name="usbdevfilter"/> + </zeroOrMore> + </element> + </define> + + <define name="hostdev"> + <element name="hostdev"> + <interleave> + <choice> + <group> + <ref name="hostdevsubsys"/> + </group> + <group> + <ref name="hostdevcaps"/> + </group> + </choice> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="deviceBoot"/> + </optional> + <optional> + <ref name="rom"/> + </optional> + <optional> + <ref name="address"/> + </optional> + <optional> + <element name="readonly"> + <empty/> + </element> + </optional> + <optional> + <element name="shareable"> + <empty/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="hostdevsubsys"> + <optional> + <attribute name="mode"> + <value>subsystem</value> + </attribute> + </optional> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <choice> + <ref name="hostdevsubsyspci"/> + <ref name="hostdevsubsysusb"/> + <ref name="hostdevsubsysscsi"/> + <ref name="hostdevsubsyshost"/> + <ref name="hostdevsubsysmdev"/> + </choice> + </define> + + <define name="hostdevcaps"> + <attribute name="mode"> + <value>capabilities</value> + </attribute> + <choice> + <group> + <ref name="hostdevcapsstorage"/> + </group> + <group> + <ref name="hostdevcapsmisc"/> + </group> + <group> + <ref name="hostdevcapsnet"/> + </group> + </choice> + </define> + + + <define name="hostdevsubsyspci"> + <attribute name="type"> + <value>pci</value> + </attribute> + <interleave> + <optional> + <ref name="hostdevDriver"/> + </optional> + <optional> + <ref name="teaming"/> + </optional> + <element name="source"> + <optional> + <ref name="startupPolicy"/> + </optional> + <optional> + <attribute name="writeFiltering"> + <ref name="virYesNo"/> + </attribute> + </optional> + <element name="address"> + <ref name="pciaddress"/> + </element> + </element> + <ref name="hostdevsubsysvfiodisplay"/> + </interleave> + </define> + + <define name="hostdevsubsysusb"> + <attribute name="type"> + <value>usb</value> + </attribute> + <element name="source"> + <optional> + <ref name="startupPolicy"/> + </optional> + <optional> + <attribute name="guestReset"> + <choice> + <value>off</value> + <value>uninitialized</value> + <value>on</value> + </choice> + </attribute> + </optional> + <choice> + <group> + <ref name="usbproduct"/> + <optional> + <ref name="usbaddress"/> + </optional> + </group> + <ref name="usbaddress"/> + </choice> + </element> + </define> + + <define name="hostdevsubsysscsi"> + <attribute name="type"> + <value>scsi</value> + </attribute> + <optional> + <ref name="sgIO"/> + </optional> + <optional> + <ref name="rawIO"/> + </optional> + <element name="source"> + <choice> + <group> <!-- scsi_host adapter --> + <optional> + <attribute name="protocol"> + <value>adapter</value> <!-- scsi_host, default, optional --> + </attribute> + </optional> + <interleave> + <ref name="sourceinfoadapter"/> + <element name="address"> + <ref name="scsiaddress"/> + </element> + </interleave> + </group> + <group> <!-- iscsi adapter --> + <attribute name="protocol"> + <value>iscsi</value> <!-- iscsi, required --> + </attribute> + <attribute name="name"> + <text/> + </attribute> + <interleave> + <oneOrMore> + <element name="host"> + <attribute name="name"> + <text/> + </attribute> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <empty/> + </element> + </oneOrMore> + <optional> + <ref name="diskAuth"/> + </optional> + <optional> + <ref name="initiatorinfo"/> + </optional> + </interleave> + </group> + </choice> + </element> + </define> + + <define name="hostdevsubsyshost"> + <attribute name="type"> + <value>scsi_host</value> + </attribute> + <optional> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + </optional> + <element name="source"> + <choice> + <group> + <attribute name="protocol"> + <value>vhost</value> <!-- vhost, required --> + </attribute> + <attribute name="wwpn"> + <data type="string"> + <param name="pattern">(naa\.)[0-9a-fA-F]{16}</param> + </data> + </attribute> + </group> + </choice> + </element> + </define> + + <define name="hostdevsubsysvfiodisplay"> + <optional> + <attribute name="ramfb"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="display"> + <ref name="virOnOff"/> + </attribute> + </optional> + </define> + + <define name="hostdevsubsysmdev"> + <attribute name="type"> + <value>mdev</value> + </attribute> + <attribute name="model"> + <choice> + <value>vfio-pci</value> + <value>vfio-ccw</value> + <value>vfio-ap</value> + </choice> + </attribute> + <ref name="hostdevsubsysvfiodisplay"/> + <element name="source"> + <ref name="mdevaddress"/> + </element> + </define> + + <define name="hostdevcapsstorage"> + <attribute name="type"> + <value>storage</value> + </attribute> + <element name="source"> + <element name="block"> + <ref name="absFilePath"/> + </element> + </element> + </define> + + <define name="hostdevcapsmisc"> + <attribute name="type"> + <value>misc</value> + </attribute> + <element name="source"> + <element name="char"> + <ref name="absFilePath"/> + </element> + </element> + </define> + + <define name="hostdevcapsnet"> + <attribute name="type"> + <value>net</value> + </attribute> + <interleave> + <element name="source"> + <element name="interface"> + <ref name="deviceName"/> + </element> + </element> + <ref name="interface-ip-info"/> + </interleave> + </define> + + <define name="usbproduct"> + <element name="vendor"> + <attribute name="id"> + <ref name="usbId"/> + </attribute> + </element> + <element name="product"> + <attribute name="id"> + <ref name="usbId"/> + </attribute> + </element> + </define> + <define name="usbaddress"> + <element name="address"> + <attribute name="bus"> + <ref name="usbAddr"/> + </attribute> + <attribute name="device"> + <ref name="usbAddr"/> + </attribute> + </element> + </define> + <define name="scsiaddress"> + <attribute name="bus"> + <ref name="driveBus"/> + </attribute> + <attribute name="target"> + <ref name="driveSCSITarget"/> + </attribute> + <attribute name="unit"> + <ref name="driveSCSIUnit"/> + </attribute> + </define> + <define name="usbportaddress"> + <attribute name="bus"> + <ref name="usbAddr"/> + </attribute> + <optional> + <attribute name="port"> + <ref name="usbPort"/> + </attribute> + </optional> + </define> + <define name="spaprvioaddress"> + <optional> + <attribute name="reg"> + <ref name="spaprvioReg"/> + </attribute> + </optional> + </define> + <define name="ccwaddress"> + <optional> + <attribute name="cssid"> + <ref name="ccwCssidRange"/> + </attribute> + <attribute name="ssid"> + <ref name="ccwSsidRange"/> + </attribute> + <attribute name="devno"> + <ref name="ccwDevnoRange"/> + </attribute> + </optional> + </define> + <define name="driveaddress"> + <optional> + <attribute name="controller"> + <ref name="driveController"/> + </attribute> + </optional> + <optional> + <attribute name="bus"> + <ref name="driveBus"/> + </attribute> + </optional> + <optional> + <attribute name="target"> + <ref name="driveTarget"/> + </attribute> + </optional> + <optional> + <attribute name="unit"> + <ref name="driveUnit"/> + </attribute> + </optional> + </define> + <define name="virtioserialaddress"> + <attribute name="controller"> + <ref name="driveController"/> + </attribute> + <optional> + <attribute name="bus"> + <ref name="driveBus"/> + </attribute> + </optional> + <optional> + <attribute name="port"> + <ref name="virtioserialPort"/> + </attribute> + </optional> + </define> + <define name="ccidaddress"> + <attribute name="controller"> + <ref name="driveController"/> + </attribute> + <optional> + <attribute name="slot"> + <ref name="ccidSlot"/> + </attribute> + </optional> + </define> + <define name="dimmaddress"> + <optional> + <attribute name="slot"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="base"> + <ref name="hexuint"/> + </attribute> + </optional> + </define> + <define name="mdevaddress"> + <element name="address"> + <attribute name="uuid"> + <ref name="UUID"/> + </attribute> + </element> + </define> + <define name="devices"> + <element name="devices"> + <interleave> + <optional> + <ref name="emulator"/> + </optional> + <zeroOrMore> + <choice> + <ref name="disk"/> + <ref name="controller"/> + <ref name="lease"/> + <ref name="filesystem"/> + <ref name="interface"/> + <ref name="input"/> + <ref name="sound"/> + <ref name="audio"/> + <ref name="hostdev"/> + <ref name="graphic"/> + <ref name="video"/> + <ref name="console"/> + <ref name="parallel"/> + <ref name="serial"/> + <ref name="channel"/> + <ref name="smartcard"/> + <ref name="hub"/> + <ref name="redirdev"/> + <ref name="redirfilter"/> + <ref name="rng"/> + <ref name="tpm"/> + <ref name="shmem"/> + <ref name="memorydev"/> + <ref name="crypto"/> + </choice> + </zeroOrMore> + <zeroOrMore> + <ref name="watchdog"/> + </zeroOrMore> + <optional> + <ref name="memballoon"/> + </optional> + <optional> + <ref name="nvram"/> + </optional> + <zeroOrMore> + <ref name="panic"/> + </zeroOrMore> + <optional> + <ref name="iommu"/> + </optional> + <optional> + <ref name="vsock"/> + </optional> + </interleave> + </element> + </define> + <!-- + A set of optional features: PAE, APIC, ACPI, GIC, TCG, + HyperV Enlightenment, KVM features, paravirtual spinlocks and HAP support + --> + <define name="features"> + <optional> + <element name="features"> + <interleave> + <optional> + <element name="pae"> + <empty/> + </element> + </optional> + <optional> + <element name="apic"> + <optional> + <attribute name="eoi"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="acpi"> + <empty/> + </element> + </optional> + <optional> + <element name="hap"> + <optional> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <ref name="hyperv"/> + </optional> + <optional> + <element name="viridian"> + <empty/> + </element> + </optional> + <optional> + <ref name="kvm"/> + </optional> + <optional> + <ref name="xen"/> + </optional> + <optional> + <element name="privnet"> + <empty/> + </element> + </optional> + <optional> + <element name="pvspinlock"> + <optional> + <ref name="featurestate"/> + </optional> + <empty/> + </element> + </optional> + <optional> + <ref name="capabilities"/> + </optional> + <optional> + <ref name="pmu"/> + </optional> + <optional> + <element name="vmport"> + <optional> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="gic"> + <optional> + <attribute name="version"> + <choice> + <value>host</value> + <value>2</value> + <value>3</value> + </choice> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="smm"> + <optional> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + <optional> + <element name="tseg"> + <ref name="scaledInteger"/> + </element> + </optional> + </optional> + </element> + </optional> + <optional> + <ref name="ioapic"/> + </optional> + <optional> + <ref name="hpt"/> + </optional> + <optional> + <ref name="vmcoreinfo"/> + </optional> + <optional> + <element name="htm"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="nested-hv"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <ref name="msrs"/> + </optional> + <optional> + <element name="ccf-assist"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <ref name="cfpc"/> + </optional> + <optional> + <ref name="sbbc"/> + </optional> + <optional> + <ref name="ibs"/> + </optional> + <optional> + <ref name="tcgfeatures"/> + </optional> + <optional> + <element name="async-teardown"> + <optional> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </optional> + </define> + + <!-- + System information specification: + Placeholder for system specific information likes the ones + contained in the SMBIOS area. + Only a limited subset of entries can be modified there, so we + fully enumerate each case here. + The DMTF spec doesn't specify any string subset, just 0 terminated + byte strings, but better be safe and restrict at least the names + to avoid problems with space normalization in attribute values, + the value is kept as the element body for maximum flexibility. + A priori we allow only type 0 and type 1 string updates + --> + <define name="sysinfo"> + <element name="sysinfo"> + <choice> + <group> + <attribute name="type"> + <value>smbios</value> + </attribute> + <interleave> + <optional> + <element name="bios"> + <oneOrMore> + <element name="entry"> + <attribute name="name"> + <ref name="sysinfo-bios-name"/> + </attribute> + <ref name="sysinfo-value"/> + </element> + </oneOrMore> + </element> + </optional> + <optional> + <element name="system"> + <oneOrMore> + <element name="entry"> + <attribute name="name"> + <ref name="sysinfo-system-name"/> + </attribute> + <ref name="sysinfo-value"/> + </element> + </oneOrMore> + </element> + </optional> + <zeroOrMore> + <element name="baseBoard"> + <oneOrMore> + <element name="entry"> + <attribute name="name"> + <ref name="sysinfo-baseBoard-name"/> + </attribute> + <ref name="sysinfo-value"/> + </element> + </oneOrMore> + </element> + </zeroOrMore> + <optional> + <element name="chassis"> + <oneOrMore> + <element name="entry"> + <attribute name="name"> + <ref name="sysinfo-chassis-name"/> + </attribute> + <ref name="sysinfo-value"/> + </element> + </oneOrMore> + </element> + </optional> + <optional> + <element name="oemStrings"> + <oneOrMore> + <element name="entry"> + <ref name="sysinfo-value"/> + </element> + </oneOrMore> + </element> + </optional> + </interleave> + </group> + <group> + <attribute name="type"> + <value>fwcfg</value> + </attribute> + <zeroOrMore> + <element name="entry"> + <attribute name="name"> + <data type="string"/> + </attribute> + <choice> + <group> + <attribute name="file"> + <data type="string"/> + </attribute> + <empty/> + </group> + <group> + <ref name="sysinfo-value"/> + </group> + </choice> + </element> + </zeroOrMore> + </group> + </choice> + </element> + </define> + + <define name="sysinfo-bios-name"> + <choice> + <value>vendor</value> + <value>version</value> + <value>date</value> + <value>release</value> + </choice> + </define> + + <define name="sysinfo-system-name"> + <choice> + <value>manufacturer</value> + <value>product</value> + <value>version</value> + <value>serial</value> + <value>uuid</value> + <value>sku</value> + <value>family</value> + </choice> + </define> + + <define name="sysinfo-baseBoard-name"> + <choice> + <value>manufacturer</value> + <value>product</value> + <value>version</value> + <value>serial</value> + <value>asset</value> + <value>location</value> + </choice> + </define> + + <define name="sysinfo-chassis-name"> + <choice> + <value>manufacturer</value> + <value>version</value> + <value>serial</value> + <value>asset</value> + <value>sku</value> + </choice> + </define> + + <define name="sysinfo-value"> + <data type="string"/> + </define> + + <define name="acpiTable"> + <element name="acpi"> + <zeroOrMore> + <element name="table"> + <attribute name="type"> + <value>slic</value> + </attribute> + <ref name="absFilePath"/> + </element> + </zeroOrMore> + </element> + </define> + + <define name="smbios"> + <element name="smbios"> + <attribute name="mode"> + <choice> + <value>emulate</value> + <value>host</value> + <value>sysinfo</value> + </choice> + </attribute> + <empty/> + </element> + </define> + + <define name="bios"> + <element name="bios"> + <optional> + <attribute name="useserial"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="rebootTimeout"> + <ref name="rebootTimeoutDelay"/> + </attribute> + </optional> + </element> + </define> + + <define name="ioapic"> + <element name="ioapic"> + <attribute name="driver"> + <choice> + <value>qemu</value> + <value>kvm</value> + </choice> + </attribute> + <empty/> + </element> + </define> + + <define name="hpt"> + <element name="hpt"> + <optional> + <attribute name="resizing"> + <choice> + <value>enabled</value> + <value>disabled</value> + <value>required</value> + </choice> + </attribute> + </optional> + <optional> + <element name="maxpagesize"> + <ref name="scaledInteger"/> + </element> + </optional> + </element> + </define> + + <define name="vmcoreinfo"> + <element name="vmcoreinfo"> + <optional> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + </optional> + </element> + </define> + + <define name="msrs"> + <element name="msrs"> + <attribute name="unknown"> + <choice> + <value>ignore</value> + <value>fault</value> + </choice> + </attribute> + </element> + </define> + + <define name="cfpc"> + <element name="cfpc"> + <attribute name="value"> + <choice> + <value>broken</value> + <value>workaround</value> + <value>fixed</value> + </choice> + </attribute> + </element> + </define> + + <define name="sbbc"> + <element name="sbbc"> + <attribute name="value"> + <choice> + <value>broken</value> + <value>workaround</value> + <value>fixed</value> + </choice> + </attribute> + </element> + </define> + + <define name="ibs"> + <element name="ibs"> + <attribute name="value"> + <choice> + <value>broken</value> + <value>workaround</value> + <value>fixed-ibs</value> + <value>fixed-ccd</value> + <value>fixed-na</value> + </choice> + </attribute> + </element> + </define> + + <define name="tcgfeatures"> + <element name="tcg"> + <optional> + <element name="tb-cache"> + <ref name="scaledInteger"/> + </element> + </optional> + </element> + </define> + + <define name="address"> + <element name="address"> + <choice> + <group> + <attribute name="type"> + <value>pci</value> + </attribute> + <ref name="pciaddress"/> + <ref name="zpciaddress"/> + </group> + <group> + <attribute name="type"> + <value>drive</value> + </attribute> + <ref name="driveaddress"/> + </group> + <group> + <attribute name="type"> + <value>virtio-serial</value> + </attribute> + <ref name="virtioserialaddress"/> + </group> + <group> + <attribute name="type"> + <value>ccid</value> + </attribute> + <ref name="ccidaddress"/> + </group> + <group> + <attribute name="type"> + <value>usb</value> + </attribute> + <ref name="usbportaddress"/> + </group> + <group> + <attribute name="type"> + <value>spapr-vio</value> + </attribute> + <ref name="spaprvioaddress"/> + </group> + <group> + <attribute name="type"> + <value>ccw</value> + </attribute> + <ref name="ccwaddress"/> + </group> + <group> + <attribute name="type"> + <value>isa</value> + </attribute> + <ref name="isaaddress"/> + </group> + <group> + <attribute name="type"> + <value>virtio-mmio</value> + </attribute> + </group> + <group> + <attribute name="type"> + <value>dimm</value> + </attribute> + <ref name="dimmaddress"/> + </group> + <group> + <attribute name="type"> + <value>unassigned</value> + </attribute> + </group> + </choice> + </element> + </define> + + <define name="rom"> + <element name="rom"> + <optional> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="bar"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + </optional> + <empty/> + </element> + </define> + + <define name="acpi"> + <element name="acpi"> + <optional> + <attribute name="index"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </define> + + <define name="memorydev"> + <element name="memory"> + <attribute name="model"> + <choice> + <value>dimm</value> + <value>nvdimm</value> + <value>virtio-pmem</value> + <value>virtio-mem</value> + <value>sgx-epc</value> + </choice> + </attribute> + <optional> + <attribute name="access"> + <choice> + <value>shared</value> + <value>private</value> + </choice> + </attribute> + </optional> + <optional> + <attribute name="discard"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <optional> + <ref name="memorydev-source"/> + </optional> + <ref name="memorydev-target"/> + <optional> + <ref name="address"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + </interleave> + </element> + </define> + + <define name="memorydev-source"> + <element name="source"> + <choice> + <group> + <interleave> + <optional> + <element name="pagesize"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="nodemask"> + <ref name="cpuset"/> + </element> + </optional> + </interleave> + </group> + <group> + <interleave> + <element name="path"> + <ref name="absFilePath"/> + </element> + <optional> + <element name="alignsize"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="pmem"> + <empty/> + </element> + </optional> + </interleave> + </group> + </choice> + </element> + </define> + + <define name="memorydev-target"> + <element name="target"> + <optional> + <attribute name="dynamicMemslots"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <element name="size"> + <ref name="scaledInteger"/> + </element> + <optional> + <element name="node"> + <ref name="unsignedInt"/> + </element> + </optional> + <optional> + <element name="block"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="requested"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="current"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="label"> + <element name="size"> + <ref name="scaledInteger"/> + </element> + </element> + </optional> + <optional> + <element name="readonly"> + <empty/> + </element> + </optional> + <optional> + <element name="address"> + <attribute name="base"> + <ref name="hexuint"/> + </attribute> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="rng"> + <element name="rng"> + <attribute name="model"> + <choice> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </choice> + </attribute> + <interleave> + <ref name="rng-backend"/> + <optional> + <element name="driver"> + <ref name="virtioOptions"/> + </element> + </optional> + <optional> + <ref name="rng-rate"/> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="acpi"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="rng-backend"> + <element name="backend"> + <choice> + <group> + <attribute name="model"> + <value>random</value> + </attribute> + <choice> + <ref name="absFilePath"/> + <empty/> + </choice> + </group> + <group> + <attribute name="model"> + <value>egd</value> + </attribute> + <ref name="qemucdevSrcType"/> + <ref name="qemucdevSrcDef"/> + </group> + <group> + <attribute name="model"> + <value>builtin</value> + </attribute> + <empty/> + </group> + </choice> + </element> + </define> + + <define name="rng-rate"> + <element name="rate"> + <attribute name="bytes"> + <ref name="positiveInteger"/> + </attribute> + <optional> + <attribute name="period"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <empty/> + </element> + </define> + + <define name="crypto"> + <element name="crypto"> + <attribute name="model"> + <choice> + <value>virtio</value> + </choice> + </attribute> + <attribute name="type"> + <choice> + <value>qemu</value> + </choice> + </attribute> + <interleave> + <ref name="crypto-backend"/> + <optional> + <element name="driver"> + <ref name="virtioOptions"/> + </element> + </optional> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + + <define name="crypto-backend"> + <element name="backend"> + <choice> + <group> + <attribute name="model"> + <value>builtin</value> + </attribute> + <optional> + <attribute name="queues"> + <ref name="positiveInteger"/> + </attribute> + </optional> + </group> + <group> + <attribute name="model"> + <value>lkcf</value> + </attribute> + <optional> + <attribute name="queues"> + <ref name="positiveInteger"/> + </attribute> + </optional> + </group> + </choice> + </element> + </define> + + + <define name="virtioOptions"> + <optional> + <attribute name="iommu"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="ats"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="packed"> + <ref name="virOnOff"/> + </attribute> + </optional> + <optional> + <attribute name="page_per_vq"> + <ref name="virOnOff"/> + </attribute> + </optional> + </define> + + <define name="usbmaster"> + <element name="master"> + <attribute name="startport"> + <ref name="usbPort"/> + </attribute> + <empty/> + </element> + </define> + + <define name="deviceBoot"> + <element name="boot"> + <attribute name="order"> + <ref name="positiveInteger"/> + </attribute> + <optional> + <attribute name="loadparm"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9.\s]{1,8}</param> + </data> + </attribute> + </optional> + <empty/> + </element> + </define> + + <define name="diskMirror"> + <element name="mirror"> + <interleave> + <choice> + <group> <!-- old format, for block copy back-compat --> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + <optional> + <attribute name="format"> + <ref name="storageFormat"/> + </attribute> + </optional> + <optional> + <attribute name="job"> + <value>copy</value> + </attribute> + </optional> + <optional> + <interleave> + <ref name="diskSourceFile"/> + <optional> + <ref name="diskFormat"/> + </optional> + </interleave> + </optional> + </group> + <group> <!-- preferred format --> + <attribute name="job"> + <choice> + <value>copy</value> + <value>active-commit</value> + </choice> + </attribute> + <interleave> + <ref name="diskSource"/> + <optional> + <ref name="diskFormat"/> + </optional> + </interleave> + </group> + </choice> + <optional> + <attribute name="ready"> + <choice> + <value>yes</value> + <value>abort</value> + <value>pivot</value> + </choice> + </attribute> + </optional> + <ref name="diskBackingChain"/> + </interleave> + </element> + </define> + + <define name="diskAuth"> + <element name="auth"> + <attribute name="username"> + <ref name="genericName"/> + </attribute> + <ref name="diskAuthSecret"/> + </element> + </define> + + <define name="diskAuthSecret"> + <element name="secret"> + <attribute name="type"> + <choice> + <value>ceph</value> + <value>iscsi</value> + </choice> + </attribute> + <choice> + <attribute name="uuid"> + <ref name="UUID"/> + </attribute> + <attribute name="usage"> + <ref name="objectName"/> + </attribute> + </choice> + </element> + </define> + + <define name="diskIoTune"> + <element name="iotune"> + <interleave> + <choice> + <element name="total_bytes_sec"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_bytes_sec"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_bytes_sec"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + <choice> + <element name="total_iops_sec"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_iops_sec"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_iops_sec"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + <choice> + <element name="total_bytes_sec_max"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_bytes_sec_max"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_bytes_sec_max"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + <choice> + <element name="total_iops_sec_max"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_iops_sec_max"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_iops_sec_max"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + <optional> + <element name="size_iops_sec"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="group_name"> + <text/> + </element> + </optional> + <choice> + <element name="total_bytes_sec_max_length"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_bytes_sec_max_length"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_bytes_sec_max_length"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + <choice> + <element name="total_iops_sec_max_length"> + <data type="unsignedLong"/> + </element> + <group> + <interleave> + <optional> + <element name="read_iops_sec_max_length"> + <data type="unsignedLong"/> + </element> + </optional> + <optional> + <element name="write_iops_sec_max_length"> + <data type="unsignedLong"/> + </element> + </optional> + </interleave> + </group> + </choice> + </interleave> + </element> + </define> + + <define name="pflashFormat"> + <attribute name="format"> + <choice> + <value>raw</value> + <value>qcow2</value> + </choice> + </attribute> + </define> + + <!-- Optional HyperV Enlightenment features --> + <define name="hyperv"> + <element name="hyperv"> + <choice> + <attribute name="mode"> + <value>passthrough</value> + </attribute> + <group> + <optional> + <attribute name="mode"> + <value>custom</value> + </attribute> + </optional> + <interleave> + <optional> + <element name="relaxed"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="vapic"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="spinlocks"> + <ref name="featurestate"/> + <optional> + <attribute name="retries"> + <data type="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="vpindex"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="runtime"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="synic"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="stimer"> + <ref name="stimer"/> + </element> + </optional> + <optional> + <element name="reset"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="vendor_id"> + <ref name="featurestate"/> + <optional> + <attribute name="value"> + <data type="string"> + <param name="pattern">[^,]{0,12}</param> + </data> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="frequencies"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="reenlightenment"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="tlbflush"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="ipi"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="evmcs"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="avic"> + <ref name="featurestate"/> + </element> + </optional> + </interleave> + </group> + </choice> + </element> + </define> + + <!-- Hyper-V stimer features --> + <define name="stimer"> + <interleave> + <optional> + <ref name="featurestate"/> + </optional> + <optional> + <element name="direct"> + <ref name="featurestate"/> + </element> + </optional> + </interleave> + </define> + + <!-- Optional KVM features --> + <define name="kvm"> + <element name="kvm"> + <interleave> + <optional> + <element name="hidden"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="hint-dedicated"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="poll-control"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="pv-ipi"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="dirty-ring"> + <ref name="featurestate"/> + <optional> + <attribute name="size"> + <data type="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </define> + + <!-- Optional Xen features --> + <define name="xen"> + <element name="xen"> + <interleave> + <optional> + <element name="e820_host"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="passthrough"> + <ref name="featurestate"/> + <optional> + <attribute name="mode"> + <data type="string"> + <param name="pattern">(sync_pt|share_pt)</param> + </data> + </attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </define> + + <!-- Optional capabilities features --> + <define name="capabilities"> + <element name="capabilities"> + <ref name="capabilitiespolicy"/> + <interleave> + <optional> + <element name="audit_control"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="audit_write"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="block_suspend"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="chown"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="dac_override"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="dac_read_search"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="fowner"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="fsetid"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="ipc_lock"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="ipc_owner"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="kill"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="lease"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="linux_immutable"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="mac_admin"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="mac_override"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="mknod"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="net_admin"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="net_bind_service"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="net_broadcast"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="net_raw"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="setgid"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="setfcap"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="setpcap"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="setuid"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_admin"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_boot"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_chroot"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_module"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_nice"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_pacct"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_ptrace"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_rawio"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_resource"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_time"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="sys_tty_config"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="syslog"> + <ref name="featurestate"/> + </element> + </optional> + <optional> + <element name="wake_alarm"> + <ref name="featurestate"/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="pmu"> + <element name="pmu"> + <optional> + <ref name="featurestate"/> + </optional> + </element> + </define> + + <define name="featurestate"> + <attribute name="state"> + <ref name="virOnOff"/> + </attribute> + </define> + + <define name="capabilitiespolicy"> + <attribute name="policy"> + <choice> + <value>default</value> + <value>allow</value> + <value>deny</value> + </choice> + </attribute> + </define> + + <!-- + Optional hypervisor extensions in their own namespace: + QEMU + --> + <define name="qemucmdline"> + <element name="commandline" ns="http://libvirt.org/schemas/domain/qemu/1.0"> + <interleave> + <zeroOrMore> + <element name="arg"> + <attribute name="value"/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="env"> + <attribute name="name"> + <ref name="filter-param-name"/> + </attribute> + <optional> + <attribute name="value"/> + </optional> + <empty/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="qemucapabilities"> + <element name="capabilities" ns="http://libvirt.org/schemas/domain/qemu/1.0"> + <interleave> + <zeroOrMore> + <element name="add"> + <attribute name="capability"/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="del"> + <attribute name="capability"/> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="qemudeprecation"> + <element name="deprecation" ns="http://libvirt.org/schemas/domain/qemu/1.0"> + <attribute name="behavior"> + <choice> + <value>none</value> + <value>omit</value> + <value>reject</value> + <value>crash</value> + </choice> + </attribute> + </element> + </define> + + <define name="qemuoverrideproperty"> + <element name="property" ns="http://libvirt.org/schemas/domain/qemu/1.0"> + <attribute name="name"/> + <attribute name="type"> + <choice> + <value>string</value> + <value>signed</value> + <value>unsigned</value> + <value>bool</value> + <value>remove</value> + </choice> + </attribute> + <optional> + <attribute name="value"/> + </optional> + </element> + </define> + + <define name="qemuoverride"> + <element name="override" ns="http://libvirt.org/schemas/domain/qemu/1.0"> + <interleave> + <zeroOrMore> + <element name="device"> + <attribute name="alias"/> + <interleave> + <optional> + <element name="frontend"> + <zeroOrMore> + <ref name="qemuoverrideproperty"/> + </zeroOrMore> + </element> + </optional> + </interleave> + </element> + </zeroOrMore> + </interleave> + </element> + </define> + + + <!-- + Optional hypervisor extensions in their own namespace: + LXC + --> + <define name="lxcsharens"> + <element name="namespace" ns="http://libvirt.org/schemas/domain/lxc/1.0"> + <interleave> + <optional> + <element name="sharenet"> + <attribute name="type"> + <choice> + <value>netns</value> + <value>name</value> + <value>pid</value> + </choice> + </attribute> + <attribute name="value"/> + </element> + </optional> + <optional> + <element name="shareipc"> + <attribute name="type"> + <choice> + <value>name</value> + <value>pid</value> + </choice> + </attribute> + <attribute name="value"/> + </element> + </optional> + <optional> + <element name="shareuts"> + <attribute name="type"> + <choice> + <value>name</value> + <value>pid</value> + </choice> + </attribute> + <attribute name="value"/> + </element> + </optional> + </interleave> + </element> + </define> + + <!-- + Optional hypervisor extensions in their own namespace: + Bhyve + --> + <define name="bhyvecmdline"> + <element name="commandline" ns="http://libvirt.org/schemas/domain/bhyve/1.0"> + <zeroOrMore> + <element name="arg"> + <attribute name="value"/> + </element> + </zeroOrMore> + </element> + </define> + + <!-- + Optional hypervisor extensions in their own namespace: + Xen + --> + <define name="xencmdline"> + <element name="commandline" ns="http://libvirt.org/schemas/domain/xen/1.0"> + <zeroOrMore> + <element name="arg"> + <attribute name="value"/> + </element> + </zeroOrMore> + </element> + </define> + + <!-- + Optional hypervisor extensions in their own namespace: + vmware + --> + <define name="vmwaredatacenterpath"> + <element name="datacenterpath" ns="http://libvirt.org/schemas/domain/vmware/1.0"> + <text/> + </element> + </define> + + <!-- + Type library + --> + <define name="countCPU"> + <data type="unsignedShort"> + <param name="pattern">[0-9]+</param> + <param name="minInclusive">1</param> + </data> + </define> + <define name="vcpuid"> + <data type="unsignedShort"> + <param name="pattern">[0-9]+</param> + </data> + </define> + <define name="cpushares"> + <data type="unsignedInt"> + <param name="pattern">[0-9]+</param> + </data> + </define> + <define name="cpuperiod"> + <data type="unsignedLong"> + <param name="pattern">[0-9]+</param> + <param name="minInclusive">1000</param> + <param name="maxInclusive">1000000</param> + </data> + </define> + <define name="cpuquota"> + <data type="long"> + <param name="pattern">-?[0-9]+</param> + <param name="maxInclusive">17592186044415</param> + <param name="minInclusive">-1</param> + </data> + </define> + <define name="rebootTimeoutDelay"> + <data type="short"> + <param name="minInclusive">-1</param> + </data> + </define> + <!-- weight currently is in range [100, 1000] --> + <define name="weight"> + <data type="unsignedInt"> + <param name="pattern">[0-9]+</param> + <param name="minInclusive">100</param> + <param name="maxInclusive">1000</param> + </data> + </define> + <define name="diskSerial"> + <data type="string"> + <param name="pattern">[A-Za-z0-9_\.\+\- ]+</param> + </data> + </define> + <define name="bridgeMode"> + <data type="string"> + <param name="pattern">(vepa|bridge|private|passthrough)</param> + </data> + </define> + <define name="addrIPorName"> + <choice> + <ref name="ipAddr"/> + <ref name="dnsName"/> + </choice> + </define> + <define name="usbIdDefault"> + <data type="string"> + <param name="pattern">-1</param> + </data> + </define> + <define name="usbId"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param> + </data> + </define> + <define name="usbVersion"> + <data type="string"> + <param name="pattern">[0-9]{1,2}.[0-9]{1,2}</param> + </data> + </define> + <define name="usbAddr"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param> + </data> + </define> + <define name="usbClass"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param> + </data> + </define> + <define name="usbPort"> + <data type="string"> + <param name="pattern">((0x)?[0-9a-fA-F]{1,3}\.){0,3}(0x)?[0-9a-fA-F]{1,3}</param> + </data> + </define> + <define name="driveController"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="driveBus"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="driveTarget"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="driveSCSITarget"> + <data type="string"> + <param name="pattern">[0-9]{1,10}</param> + </data> + </define> + <define name="driveUnit"> + <data type="string"> + <param name="pattern">[0-9]{1,5}</param> + </data> + </define> + <define name="driveSCSIUnit"> + <data type="string"> + <param name="pattern">[0-9]{1,20}</param> + </data> + </define> + <define name="timeDelta"> + <data type="string"> + <param name="pattern">(-|\+)?[0-9]+</param> + </data> + </define> + <define name="timeZone"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.\+\-/]+</param> + </data> + </define> + <define name="spaprvioReg"> + <data type="string"> + <param name="pattern">(0x)?[0-9a-fA-F]{1,8}</param> + </data> + </define> + <define name="aliasName"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\-.]+</param> + </data> + </define> + <define name="virtioserialPort"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="ccidSlot"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="alias"> + <element name="alias"> + <attribute name="name"> + <ref name="aliasName"/> + </attribute> + </element> + <empty/> + </define> + <define name="panic"> + <element name="panic"> + <optional> + <attribute name="model"> + <choice> + <value>isa</value> + <value>pseries</value> + <value>hyperv</value> + <value>s390</value> + <value>pvpanic</value> + </choice> + </attribute> + </optional> + <interleave> + <optional> + <ref name="alias"/> + </optional> + <optional> + <ref name="address"/> + </optional> + </interleave> + </element> + </define> + <define name="rawIO"> + <attribute name="rawio"> + <ref name="virYesNo"/> + </attribute> + </define> + <define name="sgIO"> + <attribute name="sgio"> + <choice> + <value>filtered</value> + <value>unfiltered</value> + </choice> + </attribute> + </define> + + <define name="coalesce"> + <element name="coalesce"> + <interleave> + <optional> + <element name="rx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <!-- + This is how we'd add more Rx-related settings for + frames, like irq, high, and low + + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + + --> + </element> + </optional> + <!-- + This is how we'd add more Rx-related settings, like + usecs + + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + --> + </element> + </optional> + <!-- + This is how you would add more coalesce settings, like + Tx-related ones + + <optional> + <element name="tx"> + <optional> + <element name="frames"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + <optional> + <element name="usecs"> + <optional> + <attribute name="max"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="irq"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="high"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="low"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </element> + </optional> + </element> + </optional> + --> + </interleave> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domainoverrides.rng b/src/main/resources/libvirt/rng/domainoverrides.rng new file mode 100644 index 0000000..13b18a2 --- /dev/null +++ b/src/main/resources/libvirt/rng/domainoverrides.rng @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- Overrides for the no-op versions of storage elements for use with domain XMLs. --> + <include href="domaincommon.rng"/> + + <define name="storageStartupPolicy" combine="choice"> + <!-- overrides the no-op version in storagecommon.rng --> + <ref name="startupPolicy"/> + </define> + + <define name="storageSourceExtra" combine="choice"> + <!-- overrides the no-op version in storagecommon.rng --> + <ref name="diskspec"/> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/domainsnapshot.rng b/src/main/resources/libvirt/rng/domainsnapshot.rng new file mode 100644 index 0000000..2549c47 --- /dev/null +++ b/src/main/resources/libvirt/rng/domainsnapshot.rng @@ -0,0 +1,253 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt domain snapshot properties XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <start> + <ref name="domainsnapshot"/> + </start> + + <include href="domaincommon.rng"/> + + <define name="domainsnapshot"> + <element name="domainsnapshot"> + <interleave> + <optional> + <element name="name"> + <text/> + </element> + </optional> + <optional> + <element name="description"> + <text/> + </element> + </optional> + <optional> + <element name="state"> + <ref name="state"/> + </element> + </optional> + <optional> + <element name="creationTime"> + <text/> + </element> + </optional> + <optional> + <element name="memory"> + <choice> + <attribute name="snapshot"> + <choice> + <value>no</value> + <value>internal</value> + </choice> + </attribute> + <group> + <optional> + <attribute name="snapshot"> + <value>external</value> + </attribute> + </optional> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + </group> + </choice> + <empty/> + </element> + </optional> + <optional> + <element name="disks"> + <zeroOrMore> + <ref name="disksnapshot"/> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="revertDisks"> + <zeroOrMore> + <ref name="disksnapshot"/> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="active"> + <choice> + <value>0</value> + <value>1</value> + </choice> + </element> + </optional> + <optional> + <choice> + <element name="domain"> + <element name="uuid"> + <ref name="UUID"/> + </element> + </element> + <!-- Nested grammar ensures that any of our overrides of + storagecommon/domaincommon defines do not conflict + with any domain.rng overrides. --> + <grammar> + <include href="domain.rng"/> + </grammar> + </choice> + </optional> + <optional> + <grammar> + <include href="inactiveDomain.rng"/> + </grammar> + </optional> + <optional> + <element name="parent"> + <element name="name"> + <text/> + </element> + </element> + </optional> + <optional> + <element name="cookie"> + <zeroOrMore> + <ref name="customElement"/> + </zeroOrMore> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="state"> + <choice> + <value>running</value> + <value>blocked</value> + <value>paused</value> + <value>shutdown</value> + <value>shutoff</value> + <value>crashed</value> + <value>disk-snapshot</value> + </choice> + </define> + + <define name="storageSourceExtra" combine="choice"> + <!-- overrides the no-op version in storagecommon.rng --> + <ref name="disksnapshotdriver"/> + </define> + + <define name="snapshotDeleteInProgress"> + <optional> + <element name="snapshotDeleteInProgress"> + <empty/> + </element> + </optional> + </define> + + <define name="disksnapshot"> + <element name="disk"> + <attribute name="name"> + <choice> + <ref name="diskTargetDev"/> + <ref name="absFilePath"/> + </choice> + </attribute> + <choice> + <attribute name="snapshot"> + <value>no</value> + </attribute> + <attribute name="snapshot"> + <value>internal</value> + </attribute> + <group> + <optional> + <attribute name="snapshot"> + <value>external</value> + </attribute> + </optional> + <choice> + <group> + <optional> + <attribute name="type"> + <value>file</value> + </attribute> + </optional> + <interleave> + <optional> + <element name="source"> + <optional> + <attribute name="file"> + <ref name="absFilePath"/> + </attribute> + </optional> + <optional> + <ref name="storageStartupPolicy"/> + </optional> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="diskSourceCommon"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <empty/> + </element> + </optional> + <ref name="storageSourceExtra"/> + <ref name="snapshotDeleteInProgress"/> + </interleave> + </group> + <group> + <attribute name="type"> + <value>block</value> + </attribute> + <interleave> + <optional> + <element name="source"> + <attribute name="dev"> + <ref name="absFilePath"/> + </attribute> + <zeroOrMore> + <ref name="devSeclabel"/> + </zeroOrMore> + <optional> + <ref name="diskSourceCommon"/> + </optional> + <optional> + <ref name="encryption"/> + </optional> + <empty/> + </element> + </optional> + <ref name="storageSourceExtra"/> + <ref name="snapshotDeleteInProgress"/> + </interleave> + </group> + <ref name="diskSourceNetwork"/> + </choice> + </group> + <attribute name="snapshot"> + <value>manual</value> + </attribute> + </choice> + </element> + </define> + + <define name="disksnapshotdriver"> + <optional> + <element name="driver"> + <optional> + <attribute name="type"> + <ref name="storageFormatBacking"/> + </attribute> + </optional> + <optional> + <element name="metadata_cache"> + <optional> + <element name="max_size"> + <ref name="scaledInteger"/> + </element> + </optional> + </element> + </optional> + </element> + </optional> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/inactiveDomain.rng b/src/main/resources/libvirt/rng/inactiveDomain.rng new file mode 100644 index 0000000..ae1207d --- /dev/null +++ b/src/main/resources/libvirt/rng/inactiveDomain.rng @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- inactiveDomain element grammar is included into domainsnapshot.rng --> + <start> + <ref name="inactiveDomain"/> + </start> + + <include href="domainoverrides.rng"/> + +</grammar> diff --git a/src/main/resources/libvirt/rng/interface.rng b/src/main/resources/libvirt/rng/interface.rng new file mode 100644 index 0000000..8c11f0d --- /dev/null +++ b/src/main/resources/libvirt/rng/interface.rng @@ -0,0 +1,434 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for network interfaces --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + xmlns:v="http://netcf.org/xml/version/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- Versions for this schema are simple integers that are incremented + every time a changed (but backwards compatible) version + is released. The current version is indicated with the v:serial + attribute on the start element. + --> + <start v:serial="4"> + <choice> + <ref name="ethernet-interface"/> + <ref name="bridge-interface"/> + <ref name="bond-interface"/> + <ref name="vlan-interface"/> + </choice> + </start> + + <include href="basictypes.rng"/> + <!-- + FIXME: How do we handle VLAN's ? Should they be their own interface + or should we treat them as an option on the base interface ? For + example, for vlan eth0.42, it would make sense to make that part of + the definition of the eth0 interface. + --> + + <!-- + Ethernet adapter + --> + <define name="basic-ethernet-content"> + <interleave> + <attribute name="type"> + <value>ethernet</value> + </attribute> + <ref name="name-attr"/> + <!-- If no MAC is given when the interface is defined, it is determined + by using the device name. + FIXME: What if device name and MAC don't specify the same NIC ? --> + <optional> + <element name="mac"> + <attribute name="address"><ref name="macAddr"/></attribute> + </element> + </optional> + <ref name="link-speed-state"/> + <!-- FIXME: Allow (some) ethtool options --> + </interleave> + </define> + + <!-- Ethernet adapter without IP addressing, e.g. for a bridge --> + <define name="bare-ethernet-interface"> + <element name="interface"> + <interleave> + <ref name="basic-ethernet-content"/> + </interleave> + </element> + </define> + + <define name="ethernet-interface"> + <element name="interface"> + <interleave> + <ref name="startmode"/> + <ref name="basic-ethernet-content"/> + <ref name="mtu"/> + <ref name="interface-addressing"/> + </interleave> + </element> + </define> + + <!-- + VLAN's + --> + <define name="vlan-interface-common"> + <attribute name="type"> + <value>vlan</value> + </attribute> + <!-- The name attribute is only useful for reporting back and is always + of the form DEVICE.VLAN + --> + <optional><ref name="name-attr"/></optional> + <ref name="link-speed-state"/> + </define> + + <define name="vlan-device"> + <element name="vlan"> + <attribute name="tag"><ref name="vlan-id"/></attribute> + <element name="interface"> + <attribute name="name"><ref name="deviceName"/></attribute> + </element> + </element> + </define> + + <define name="bare-vlan-interface"> + <element name="interface"> + <interleave> + <ref name="vlan-interface-common"/> + <ref name="vlan-device"/> + </interleave> + </element> + </define> + + <define name="vlan-interface"> + <element name="interface"> + <interleave> + <ref name="vlan-interface-common"/> + <ref name="startmode"/> + <ref name="mtu"/> + <ref name="interface-addressing"/> + <ref name="vlan-device"/> + </interleave> + </element> + </define> + + <!-- + Bridges + --> + <define name="bridge-interface"> + <element name="interface"> + <interleave> + <attribute name="type"> + <value>bridge</value> + </attribute> + <ref name="name-attr"/> + <ref name="startmode"/> + <ref name="mtu"/> + <ref name="interface-addressing"/> + <element name="bridge"> + <optional> + <attribute name="stp"> + <ref name="virOnOff"/> + </attribute> + </optional> + <!-- Bridge forward delay + (see "ip link set <dev> type bridge forward_delay") --> + <optional v:since="2"> + <attribute name="delay"><ref name="timeval"/></attribute> + </optional> + <zeroOrMore> + <choice> + <ref name="bare-ethernet-interface"/> + <ref name="bare-vlan-interface"/> + <ref v:since="2" name="bare-bond-interface"/> + </choice> + </zeroOrMore> + </element> + </interleave> + </element> + </define> + <!-- Jim Fehlig would like support for other bridge attributes, in + particular hellotime, forwarddelay, and maxage + --> + + <!-- + Bonds + --> + <define name="bond-interface-common"> + <attribute name="type"> + <value>bond</value> + </attribute> + <ref name="name-attr"/> + <ref name="link-speed-state"/> + </define> + + <define name="bond-element"> + <element name="bond"> + <optional> + <attribute name="mode"> + <choice> + <value>balance-rr</value> + <!-- The primary interface is the first interface child + of the bond element --> + <value>active-backup</value> + <value>balance-xor</value> + <value>broadcast</value> + <value>802.3ad</value> + <value>balance-tlb</value> + <value>balance-alb</value> + </choice> + </attribute> + </optional> + + <!-- FIXME: add more attributes + + mode == 802.3ad + ad_select + lacp_rate + xmit_hash_policy + + mode == active-backup + fail_over_mac + num_grat_arp when mode == active-backup (since 3.3.0) + num_unsol_na when mode == active-backup (ipv6, since 3.4.0) + + mode == balance-xor + xmit_hash_policy (since 2.6.3/3.2.2) + --> + + <interleave> + <optional> + <choice> + <element name="miimon"> + <!-- miimon frequency in ms --> + <attribute name="freq"><ref name="unsignedInt"/></attribute> + <optional> + <attribute name="downdelay"><ref name="unsignedInt"/></attribute> + </optional> + <optional> + <attribute name="updelay"><ref name="unsignedInt"/></attribute> + </optional> + <optional> + <!-- use_carrier --> + <attribute name="carrier"> + <choice> + <!-- use MII/ETHTOOL ioctl --> + <value>ioctl</value> + <!-- use netif_carrier_ok() --> + <value>netif</value> + </choice> + </attribute> + </optional> + </element> + <element name="arpmon"> + <attribute name="interval"><ref name="unsignedInt"/></attribute> + <attribute name="target"><ref name="ipv4Addr"/></attribute> + <optional> + <attribute name="validate"> + <choice> + <value>none</value> + <value>active</value> + <value>backup</value> + <value>all</value> + </choice> + </attribute> + </optional> + </element> + </choice> + </optional> + + <oneOrMore> + <!-- The slave interfaces --> + <ref name="bare-ethernet-interface"/> + </oneOrMore> + </interleave> + </element> + </define> + + <define name="bare-bond-interface"> + <element name="interface"> + <interleave> + <ref name="bond-interface-common"/> + <ref name="bond-element"/> + </interleave> + </element> + </define> + + <define name="bond-interface"> + <element name="interface"> + <interleave> + <ref name="bond-interface-common"/> + <ref name="startmode"/> + <ref name="mtu"/> + <ref name="interface-addressing"/> + <ref name="bond-element"/> + </interleave> + </element> + </define> + + <!-- Basic attributes for all interface types --> + <define name="name-attr"> + <!-- The device name, like eth0 or br2 --> + <attribute name="name"><ref name="deviceName"/></attribute> + </define> + + <define name="mtu"> + <optional> + <element name="mtu"> + <attribute name="size"><ref name="unsignedInt"/></attribute> + </element> + </optional> + </define> + + <define name="startmode"> + <optional> + <element name="start"> + <attribute name="mode"> + <choice> + <value>onboot</value> + <value>none</value> + <value>hotplug</value> + <!-- Jim Fehlig lists the following that SuSe supports: + manual, ifplug, nfsroot --> + </choice> + </attribute> + </element> + </optional> + </define> + + <!-- + Assignment of addresses to an interface, allowing for + different protocols + --> + <define name="interface-addressing"> + <choice> + <group> + <optional> + <ref name="protocol-ipv4"/> + </optional> + <optional v:since="3"> + <ref name="protocol-ipv6"/> + </optional> + </group> + <group> + <optional v:since="3"> + <ref name="protocol-ipv6"/> + </optional> + <optional> + <ref name="protocol-ipv4"/> + </optional> + </group> + </choice> + </define> + + <define name="protocol-ipv4"> + <element name="protocol"> + <attribute name="family"> + <value>ipv4</value> + </attribute> + <interleave> + <optional> + <ref name="dhcp-element"/> + </optional> + <zeroOrMore> + <element name="ip"> + <attribute name="address"><ref name="ipv4Addr"/></attribute> + <optional> + <attribute name="prefix"><ref name="ipv4Prefix"/></attribute> + </optional> + </element> + </zeroOrMore> + <optional> + <element name="route"> + <attribute name="gateway"><ref name="ipv4Addr"/></attribute> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="protocol-ipv6"> + <element name="protocol"> + <attribute name="family"> + <value>ipv6</value> + </attribute> + <interleave> + <optional> + <element name="autoconf"><empty/></element> + </optional> + <optional> + <ref name="dhcp-element"/> + </optional> + <zeroOrMore> + <element name="ip"> + <attribute name="address"><ref name="ipv6Addr"/></attribute> + <optional> + <attribute name="prefix"><ref name="ipv6Prefix"/></attribute> + </optional> + </element> + </zeroOrMore> + <optional> + <element name="route"> + <attribute name="gateway"><ref name="ipv6Addr"/></attribute> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="dhcp-element"> + <element name="dhcp"> + <optional> + <attribute name="peerdns"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </define> + + <!-- Jim Fehlig (<jfehlig@novell.com>) suggest the + following additions to DHCP: + + WRT dhcp element, would it make sense to consider hostname (hostname + to send to server) and if to change the local hostname to the + hostname delivered via dhcp? E.g. hostname="foo" (default + `hostname`) sethostname + + Also route: + setrouting (default "yes") + setdefaultroute (default "yes") + + and NIS: + nis (default "yes") + setnisdomain (default "yes") + + What about dhcpv6? A separate <dhcp6 /> element? + --> + + <!-- Jim Fehlig suggest adding static routing info + + As for routing info, how about a separate route element: + + <route gateway="192.168.0.1" /> # destination=default + <route destination="default" gateway="192.168.0.1" /> + <route destination="10.0.0.0/8" gateway="192.168.0.2" /> + <route destination="2001:DB8:C::/64" gateway="2001:DB8:C::1" /> + <route destination="2001:DB8::/32"> # unrecheable route (loopback) + + It would perhaps make sense to use iproute2 names, that is prefix + instead of destination and nexthop instead of gateway. + --> + + <!-- Type library --> + + <define name="timeval"> + <data type="double"> + <param name="minInclusive">0</param> + </data> + </define> + + <define name="vlan-id"> + <data type="unsignedInt"> + <param name="maxInclusive">4095</param> + </data> + </define> +</grammar> diff --git a/src/main/resources/libvirt/rng/network.rng b/src/main/resources/libvirt/rng/network.rng new file mode 100644 index 0000000..b7c8551 --- /dev/null +++ b/src/main/resources/libvirt/rng/network.rng @@ -0,0 +1,455 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt network XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <ref name="network"/> + </start> + + <include href="basictypes.rng"/> + <include href="networkcommon.rng"/> + + <define name="network"> + + <element name="network"> + <optional> + <attribute name="connections"> + <data type="unsignedInt"/> + </attribute> + </optional> + <!-- Enables IPv6 guest-to-guest communications on a network + with no gateways addresses specified --> + <optional> + <attribute name="ipv6"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="trustGuestRxFilters"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + + <!-- The name of the network, used to refer to it through the API + and in virsh --> + <element name="name"> + <text/> + </element> + + <!-- <title> element --> + <optional> + <ref name="title"/> + </optional> + + <!-- <description> element --> + <optional> + <ref name="description"/> + </optional> + + <!-- <metadata> element --> + <optional> + <ref name="metadata"/> + </optional> + + <!-- <uuid> element --> + <optional> + <element name="uuid"><ref name="UUID"/></element> + </optional> + + <!-- <bridge> element --> + <optional> + <!-- The name of the network to be set up; this will back + the network on the host --> + <element name="bridge"> + <optional> + <attribute name="name"> + <ref name="deviceName"/> + </attribute> + </optional> + + <optional> + <attribute name="zone"> + <ref name="zoneName"/> + </attribute> + </optional> + + <optional> + <attribute name="stp"> + <ref name="virOnOff"/> + </attribute> + </optional> + + <optional> + <attribute name="delay"> + <data type="unsignedLong"/> + </attribute> + </optional> + + <optional> + <attribute name="macTableManager"> + <ref name="macTableManager"/> + </attribute> + </optional> + + </element> + </optional> + + <!-- <mtu> element --> + <optional> + <ref name="mtu"/> + </optional> + + <!-- <mac> element --> + <optional> + <element name="mac"> + <attribute name="address"><ref name="uniMacAddr"/></attribute> + <empty/> + </element> + </optional> + + <!-- <forward> element --> + <optional> + <!-- The device through which the bridge is connected to the + rest of the network --> + <element name="forward"> + <optional> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </optional> + + <optional> + <attribute name="mode"> + <choice> + <value>nat</value> + <value>route</value> + <value>open</value> + <value>bridge</value> + <value>passthrough</value> + <value>private</value> + <value>vepa</value> + <value>hostdev</value> + </choice> + </attribute> + </optional> + + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <choice> + <group> + <zeroOrMore> + <element name="interface"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="connections"> + <data type="unsignedInt"/> + </attribute> + </optional> + </element> + </zeroOrMore> + </group> + <group> + <zeroOrMore> + <element name="address"> + <attribute name="type"> + <value>pci</value> + </attribute> + <ref name="pciaddress"/> + <optional> + <attribute name="connections"> + <data type="unsignedInt"/> + </attribute> + </optional> + </element> + </zeroOrMore> + </group> + </choice> + <optional> + <element name="pf"> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + </element> + </optional> + <optional> + <ref name="hostdevDriver"/> + </optional> + <optional> + <element name="nat"> + <optional> + <attribute name="ipv6"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="address"> + <attribute name="start"> + <ref name="ipv4Addr"/> + </attribute> + <attribute name="end"> + <ref name="ipv4Addr"/> + </attribute> + </element> + </optional> + <optional> + <element name="port"> + <attribute name="start"> + <ref name="port"/> + </attribute> + <attribute name="end"> + <ref name="port"/> + </attribute> + </element> + </optional> + </interleave> + </element> + </optional> + </interleave> + </element> + </optional> + + <!-- <virtualport> element --> + <optional> + <ref name="virtualPortProfile"/> + </optional> + + <!-- <portgroup> elements --> + <zeroOrMore> + <element name="portgroup"> + <attribute name="name"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="default"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="trustGuestRxFilters"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <optional> + <ref name="bandwidth"/> + </optional> + <optional> + <ref name="vlan"/> + </optional> + </interleave> + </element> + </zeroOrMore> + + <!-- <domain> element --> + <optional> + <element name="domain"> + <attribute name="name"><ref name="dnsName"/></attribute> + <optional> + <attribute name="localOnly"><ref name="virYesNo"/></attribute> + </optional> + <optional> + <attribute name="register"><ref name="virYesNo"/></attribute> + </optional> + </element> + </optional> + + <!-- Define the DNS related elements like TXT records + and other features in the <dns> element --> + <optional> + <element name="dns"> + <optional> + <attribute name="enable"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="forwardPlainNames"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <zeroOrMore> + <element name="forwarder"> + <optional> + <attribute name="addr"><ref name="ipAddr"/></attribute> + </optional> + <optional> + <attribute name="domain"><ref name="dnsName"/></attribute> + </optional> + <empty/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="txt"> + <attribute name="name"><ref name="dnsName"/></attribute> + <attribute name="value"><text/></attribute> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="srv"> + <attribute name="service"><text/></attribute> + <attribute name="protocol"> + <ref name="protocol"/> + </attribute> + <optional> + <attribute name="domain"><ref name="dnsName"/></attribute> + </optional> + <optional> + <attribute name="target"><text/></attribute> + </optional> + <optional> + <attribute name="port"> + <ref name="unsignedShort"/> + </attribute> + </optional> + <optional> + <attribute name="priority"> + <ref name="unsignedShort"/> + </attribute> + </optional> + <optional> + <attribute name="weight"> + <ref name="unsignedShort"/> + </attribute> + </optional> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="host"> + <attribute name="ip"><ref name="ipAddr"/></attribute> + <oneOrMore> + <element name="hostname"><ref name="dnsName"/></element> + </oneOrMore> + </element> + </zeroOrMore> + </interleave> + </element> + </optional> + <optional> + <ref name="bandwidth"/> + </optional> + <optional> + <ref name="vlan"/> + </optional> + <optional> + <ref name="portOptions"/> + </optional> + + <!-- <ip> element --> + <zeroOrMore> + <!-- The IP element sets up NAT'ing and an optional DHCP server + local to the host. --> + <element name="ip"> + <optional> + <attribute name="address"><ref name="ipAddr"/></attribute> + </optional> + <optional> + <choice> + <attribute name="netmask"><ref name="ipv4Addr"/></attribute> + <attribute name="prefix"><ref name="ipPrefix"/></attribute> + </choice> + </optional> + <optional> + <attribute name="family"><ref name="addr-family"/></attribute> + </optional> + <optional> + <attribute name="localPtr"><ref name="virYesNo"/></attribute> + </optional> + <interleave> + <optional> + <element name="tftp"> + <attribute name="root"><text/></attribute> + </element> + </optional> + <optional> + <!-- Define the range(s) of IP addresses that the DHCP + server should hand out --> + <element name="dhcp"> + <interleave> + <zeroOrMore> + <element name="range"> + <attribute name="start"><ref name="ipAddr"/></attribute> + <attribute name="end"><ref name="ipAddr"/></attribute> + <interleave> + <optional> + <element name="lease"> + <attribute name="expiry"><ref name="unsignedLong"/></attribute> + <optional> + <attribute name="unit"><ref name="leaseUnit"/></attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="host"> + <choice> + <group> + <choice> + <attribute name="mac"><ref name="uniMacAddr"/></attribute> + <attribute name="id"><ref name="DUID"/></attribute> + </choice> + <optional> + <attribute name="name"><text/></attribute> + </optional> + </group> + <attribute name="name"><text/></attribute> + </choice> + <attribute name="ip"><ref name="ipAddr"/></attribute> + <interleave> + <optional> + <element name="lease"> + <attribute name="expiry"><ref name="unsignedLong"/></attribute> + <optional> + <attribute name="unit"><ref name="leaseUnit"/></attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </zeroOrMore> + <optional> + <element name="bootp"> + <attribute name="file"><ref name="filePath"/></attribute> + <optional> + <attribute name="server"><ref name="dnsName"/></attribute> + </optional> + </element> + </optional> + </interleave> + </element> + </optional> + </interleave> + </element> + </zeroOrMore> + <!-- <route> element --> + <zeroOrMore> + <ref name="route"/> + </zeroOrMore> + + <!-- <dnsmasq:options> --> + <optional> + <element name="options" ns="http://libvirt.org/schemas/network/dnsmasq/1.0"> + <zeroOrMore> + <element name="option"> + <attribute name="value"/> + </element> + </zeroOrMore> + </element> + </optional> + </interleave> + </element> + </define> +</grammar> diff --git a/src/main/resources/libvirt/rng/networkcommon.rng b/src/main/resources/libvirt/rng/networkcommon.rng new file mode 100644 index 0000000..6df6d43 --- /dev/null +++ b/src/main/resources/libvirt/rng/networkcommon.rng @@ -0,0 +1,294 @@ +<?xml version="1.0"?> +<!-- network-related definitions used in multiple grammars --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <define name="virtualPortProfileID"> + <data type="string"> + <param name="maxLength">39</param> + </data> + </define> + + <define name="virtualPortProfile"> + <choice> + <group> + <element name="virtualport"> + <attribute name="type"> + <value>802.1Qbg</value> + </attribute> + <optional> + <element name="parameters"> + <optional> + <attribute name="managerid"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="typeid"> + <ref name="uint24"/> + </attribute> + </optional> + <optional> + <attribute name="typeidversion"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="instanceid"> + <ref name="UUID"/> + </attribute> + </optional> + </element> + </optional> + </element> + </group> + <group> + <element name="virtualport"> + <attribute name="type"> + <value>802.1Qbh</value> + </attribute> + <optional> + <element name="parameters"> + <optional> + <attribute name="profileid"> + <ref name="virtualPortProfileID"/> + </attribute> + </optional> + </element> + </optional> + </element> + </group> + <group> + <element name="virtualport"> + <attribute name="type"> + <value>openvswitch</value> + </attribute> + <optional> + <element name="parameters"> + <optional> + <attribute name="profileid"> + <ref name="virtualPortProfileID"/> + </attribute> + </optional> + <optional> + <attribute name="interfaceid"> + <ref name="UUID"/> + </attribute> + </optional> + </element> + </optional> + </element> + </group> + <group> + <element name="virtualport"> + <attribute name="type"> + <value>midonet</value> + </attribute> + <element name="parameters"> + <attribute name="interfaceid"> + <ref name="UUID"/> + </attribute> + </element> + </element> + </group> + <group> + <!-- use this when no type attribute is present --> + <element name="virtualport"> + <optional> + <element name="parameters"> + <optional> + <attribute name="managerid"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="typeid"> + <ref name="uint24"/> + </attribute> + </optional> + <optional> + <attribute name="typeidversion"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="instanceid"> + <ref name="UUID"/> + </attribute> + </optional> + <optional> + <attribute name="profileid"> + <ref name="virtualPortProfileID"/> + </attribute> + </optional> + <optional> + <attribute name="interfaceid"> + <ref name="UUID"/> + </attribute> + </optional> + </element> + </optional> + </element> + </group> + </choice> + </define> + + <define name="bandwidth"> + <element name="bandwidth"> + <optional> + <attribute name="classID"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="inbound"> + <ref name="bandwidth-attributes"/> + <empty/> + </element> + </optional> + <optional> + <element name="outbound"> + <ref name="bandwidth-attributes"/> + <empty/> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="bandwidth-attributes"> + <optional> + <attribute name="average"> + <ref name="speed"/> + </attribute> + </optional> + <optional> + <attribute name="peak"> + <ref name="speed"/> + </attribute> + </optional> + <optional> + <attribute name="floor"> + <ref name="speed"/> + </attribute> + </optional> + <optional> + <attribute name="burst"> + <ref name="BurstSize"/> + </attribute> + </optional> + </define> + + <define name="speed"> + <data type="unsignedInt"> + <param name="pattern">[0-9]+</param> + <param name="minInclusive">1</param> + </data> + </define> + <define name="BurstSize"> + <data type="unsignedInt"> + <param name="pattern">[0-9]+</param> + <param name="minInclusive">1</param> + </data> + </define> + + <define name="unsignedShort"> + <data type="integer"> + <param name="minInclusive">0</param> + <param name="maxInclusive">65535</param> + </data> + </define> + <define name="protocol"> + <data type="string"> + <param name="pattern">(tcp)|(udp)</param> + </data> + </define> + <define name="addr-family"> + <data type="string"> + <param name="pattern">(ipv4)|(ipv6)</param> + </data> + </define> + + <define name="vlan"> + <element name="vlan"> + <optional> + <attribute name="trunk"> + <value>yes</value> + </attribute> + </optional> + <oneOrMore> + <element name="tag"> + <attribute name="id"> + <data type="unsignedInt"> + <param name="maxInclusive">4095</param> + </data> + </attribute> + <optional> + <attribute name="nativeMode"> + <choice> + <value>tagged</value> + <value>untagged</value> + </choice> + </attribute> + </optional> + <empty/> + </element> + </oneOrMore> + </element> + </define> + + <define name="port"> + <data type="integer"> + <param name="minInclusive">1</param> + <param name="maxInclusive">65535</param> + </data> + </define> + + <!-- The (static) route element specifies a network address and gateway + address to access that network. Both the network address and + the gateway address must be specified. --> + <define name="route"> + <element name="route"> + <optional> + <attribute name="family"><ref name="addr-family"/></attribute> + </optional> + <attribute name="address"><ref name="ipAddr"/></attribute> + <optional> + <choice> + <attribute name="netmask"><ref name="ipv4Addr"/></attribute> + <attribute name="prefix"><ref name="ipPrefix"/></attribute> + </choice> + </optional> + <attribute name="gateway"><ref name="ipAddr"/></attribute> + <optional> + <attribute name="metric"><ref name="unsignedInt"/></attribute> + </optional> + </element> + </define> + + <define name="macTableManager"> + <choice> + <value>kernel</value> + <value>libvirt</value> + </choice> + </define> + + <define name="mtu"> + <element name="mtu"> + <attribute name="size"> + <ref name="unsignedShort"/> + </attribute> + </element> + </define> + + <define name="portOptions"> + <element name="port"> + <optional> + <attribute name="isolated"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/networkport.rng b/src/main/resources/libvirt/rng/networkport.rng new file mode 100644 index 0000000..5099555 --- /dev/null +++ b/src/main/resources/libvirt/rng/networkport.rng @@ -0,0 +1,156 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt network port XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="networkcommon.rng"/> + + <start> + <ref name="networkport"/> + </start> + + <define name="networkport"> + <element name="networkport"> + <interleave> + <element name="uuid"> + <ref name="UUID"/> + </element> + <ref name="owner"/> + <ref name="mac"/> + <optional> + <ref name="group"/> + </optional> + <optional> + <ref name="rxfilters"/> + </optional> + <optional> + <ref name="virtualPortProfile"/> + </optional> + <optional> + <ref name="bandwidth"/> + </optional> + <optional> + <ref name="vlan"/> + </optional> + <optional> + <ref name="portOptions"/> + </optional> + <optional> + <ref name="plug"/> + </optional> + </interleave> + </element> + </define> + + <define name="owner"> + <element name="owner"> + <interleave> + <element name="name"> + <text/> + </element> + <element name="uuid"> + <ref name="UUID"/> + </element> + </interleave> + </element> + </define> + + <define name="mac"> + <element name="mac"> + <attribute name="address"> + <ref name="uniMacAddr"/> + </attribute> + <empty/> + </element> + </define> + + <define name="group"> + <element name="group"> + <ref name="deviceName"/> + </element> + </define> + + <define name="rxfilters"> + <element name="rxfilters"> + <attribute name="trustGuest"> + <ref name="virYesNo"/> + </attribute> + </element> + </define> + + <define name="plug"> + <element name="plug"> + <choice> + <ref name="plugnetwork"/> + <ref name="plugbridge"/> + <ref name="plugdirect"/> + <ref name="plughostdevpci"/> + </choice> + </element> + </define> + + <define name="plugnetwork"> + <attribute name="type"> + <value>network</value> + </attribute> + <attribute name="bridge"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="macTableManager"> + <ref name="macTableManager"/> + </attribute> + </optional> + </define> + + <define name="plugbridge"> + <attribute name="type"> + <value>bridge</value> + </attribute> + <attribute name="bridge"> + <ref name="deviceName"/> + </attribute> + <optional> + <attribute name="macTableManager"> + <ref name="macTableManager"/> + </attribute> + </optional> + </define> + + <define name="plugdirect"> + <attribute name="type"> + <value>direct</value> + </attribute> + <attribute name="dev"> + <ref name="deviceName"/> + </attribute> + <attribute name="mode"> + <choice> + <value>bridge</value> + <value>passthrough</value> + <value>private</value> + <value>vepa</value> + </choice> + </attribute> + </define> + + <define name="plughostdevpci"> + <attribute name="type"> + <value>hostdev-pci</value> + </attribute> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <ref name="hostdevDriver"/> + </optional> + <element name="address"> + <ref name="pciaddress"/> + </element> + </interleave> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/nodedev.rng b/src/main/resources/libvirt/rng/nodedev.rng new file mode 100644 index 0000000..ff07313 --- /dev/null +++ b/src/main/resources/libvirt/rng/nodedev.rng @@ -0,0 +1,888 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt node device XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <start> + <ref name="device"/> + </start> + + <define name="device"> + <element name="device"> + <interleave> + <!-- The name of the network, used to refer to it through the API + and in virsh --> + <element name="name"><text/></element> + <optional> + <element name="path"><text/></element> + </optional> + <zeroOrMore> + <element name="devnode"> + <attribute name="type"> + <choice> + <value>dev</value> + <value>link</value> + </choice> + </attribute> + <text/> + </element> + </zeroOrMore> + <optional> + <ref name="parent"/> + </optional> + + <optional> + <element name="driver"> + <element name="name"><text/></element> + </element> + </optional> + + <zeroOrMore> + <ref name="capability"/> + </zeroOrMore> + </interleave> + </element> + </define> + + <define name="parent"> + <element name="parent"> + <choice> + <group> + <attribute name="wwnn"> + <ref name="wwn"/> + </attribute> + <attribute name="wwpn"> + <ref name="wwn"/> + </attribute> + <empty/> + </group> + <group> + <attribute name="fabric_wwn"> + <ref name="wwn"/> + </attribute> + <empty/> + </group> + <text/> + </choice> + </element> + </define> + + <define name="capability"> + <element name="capability"> + <choice> + <ref name="capsystem"/> + <ref name="cappcidev"/> + <ref name="capusbdev"/> + <ref name="capusbinterface"/> + <ref name="capnet"/> + <ref name="capscsigeneric"/> + <ref name="capscsihost"/> + <ref name="capscsitarget"/> + <ref name="capscsi"/> + <ref name="capstorage"/> + <ref name="capdrm"/> + <ref name="capmdev"/> + <ref name="capccwdev"/> + <ref name="capcssdev"/> + <ref name="capvdpa"/> + <ref name="capapcard"/> + <ref name="capapqueue"/> + <ref name="capapmatrix"/> + </choice> + </element> + </define> + + <define name="capsystem"> + <attribute name="type"> + <value>system</value> + </attribute> + + <optional> + <element name="product"><text/></element> + </optional> + + <element name="hardware"> + <optional> + <element name="vendor"><text/></element> + </optional> + <optional> + <element name="version"><text/></element> + </optional> + <optional> + <element name="serial"><text/></element> + </optional> + + <element name="uuid"> + <ref name="UUID"/> + </element> + </element> + + + <element name="firmware"> + <optional> + <element name="vendor"><text/></element> + </optional> + <optional> + <element name="version"><text/></element> + </optional> + <optional> + <element name="release_date"><text/></element> + </optional> + </element> + </define> + + <define name="cappcidev"> + <attribute name="type"> + <value>pci</value> + </attribute> + + <optional> + <element name="class"> + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{6}</param> + </data> + </element> + </optional> + <element name="domain"> + <ref name="unsignedLong"/> + </element> + <element name="bus"> + <ref name="unsignedLong"/> + </element> + <element name="slot"> + <ref name="unsignedLong"/> + </element> + <element name="function"> + <ref name="unsignedLong"/> + </element> + + <element name="product"> + <attribute name="id"> + <ref name="hexuint"/> + </attribute> + + <choice> + <text/> + <empty/> + </choice> + </element> + + <element name="vendor"> + <attribute name="id"> + <ref name="hexuint"/> + </attribute> + + <choice> + <text/> + <empty/> + </choice> + </element> + + <optional> + <element name="capability"> + <attribute name="type"> + <value>phys_function</value> + </attribute> + <optional> + <ref name="address"/> + </optional> + </element> + </optional> + + <optional> + <element name="capability"> + <attribute name="type"> + <value>virt_functions</value> + </attribute> + <optional> + <attribute name="maxCount"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <zeroOrMore> + <ref name="address"/> + </zeroOrMore> + </element> + </optional> + + <optional> + <element name="capability"> + <attribute name="type"> + <choice> + <value>pci-bridge</value> + <value>cardbus-bridge</value> + </choice> + </attribute> + </element> + </optional> + + <optional> + <ref name="mdev_types"/> + </optional> + + <optional> + <ref name="vpd"/> + </optional> + + <optional> + <element name="iommuGroup"> + <attribute name="number"> + <ref name="unsignedInt"/> + </attribute> + <oneOrMore> + <ref name="address"/> + </oneOrMore> + </element> + </optional> + + <optional> + <element name="numa"> + <optional> + <attribute name="node"> + <data type="int"/> + </attribute> + </optional> + </element> + </optional> + + <optional> + <element name="pci-express"> + <zeroOrMore> + <element name="link"> + <attribute name="validity"> + <choice> + <value>cap</value> + <value>sta</value> + </choice> + </attribute> + <optional> + <attribute name="port"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> + <attribute name="speed"> + <data type="string"> + <param name="pattern">[0-9]+(.[0-9]+)?</param> + </data> + </attribute> + </optional> + <attribute name="width"> + <ref name="unsignedInt"/> + </attribute> + </element> + </zeroOrMore> + </element> + </optional> + </define> + + <define name="capusbdev"> + <attribute name="type"> + <value>usb_device</value> + </attribute> + + <element name="bus"> + <ref name="unsignedLong"/> + </element> + <element name="device"> + <ref name="unsignedLong"/> + </element> + + <element name="product"> + <attribute name="id"> + <ref name="hexuint"/> + </attribute> + + <choice> + <text/> + <empty/> + </choice> + </element> + + <element name="vendor"> + <attribute name="id"> + <ref name="hexuint"/> + </attribute> + + <choice> + <text/> + <empty/> + </choice> + </element> + </define> + + <define name="capusbinterface"> + <attribute name="type"> + <value>usb</value> + </attribute> + + <element name="number"> + <ref name="unsignedLong"/> + </element> + <element name="class"> + <ref name="unsignedLong"/> + </element> + <element name="subclass"> + <ref name="unsignedLong"/> + </element> + <element name="protocol"> + <ref name="unsignedLong"/> + </element> + + <optional> + <element name="description"> + <text/> + </element> + </optional> + </define> + + <define name="capnet"> + <attribute name="type"> + <value>net</value> + </attribute> + + <element name="interface"> + <text/> + </element> + <optional> + <element name="address"> + <ref name="mac"/> + </element> + </optional> + <ref name="link-speed-state"/> + + <zeroOrMore> + <element name="feature"> + <attribute name="name"> + <ref name="netfeaturename"/> + </attribute> + </element> + </zeroOrMore> + + <zeroOrMore> + <ref name="subcapnet"/> + </zeroOrMore> + </define> + + <define name="netfeaturename"> + <data type="string"> + <param name="pattern">[a-zA-Z\-_]+</param> + </data> + </define> + + <define name="subcapnet"> + <element name="capability"> + <choice> + <ref name="subcapnet80203"/> + <ref name="subcapnet80211"/> + </choice> + </element> + </define> + + <define name="subcapnet80203"> + <attribute name="type"> + <value>80203</value> + </attribute> + </define> + + <define name="subcapnet80211"> + <attribute name="type"> + <value>80211</value> + </attribute> + </define> + + <define name="capsfchost"> + <attribute name="type"> + <value>fc_host</value> + </attribute> + + <element name="wwnn"> + <ref name="wwn"/> + </element> + + <element name="wwpn"> + <ref name="wwn"/> + </element> + + <optional> + <element name="fabric_wwn"> + <ref name="wwn"/> + </element> + </optional> + </define> + + <define name="capsvports"> + <attribute name="type"> + <value>vport_ops</value> + </attribute> + <element name="max_vports"> + <ref name="unsignedInt"/> + </element> + <element name="vports"> + <ref name="unsignedInt"/> + </element> + </define> + + <define name="capscsigeneric"> + <attribute name="type"> + <value>scsi_generic</value> + </attribute> + + <element name='char'> + <text/> + </element> + </define> + + <define name="capscsihost"> + <attribute name="type"> + <value>scsi_host</value> + </attribute> + + <element name="host"> + <ref name="unsignedLong"/> + </element> + + <optional> + <element name="unique_id"> + <ref name="unsignedInt"/> + </element> + </optional> + + <optional> + <zeroOrMore> + <element name="capability"> + <choice> + <ref name="capsfchost"/> + <ref name="capsvports"/> + </choice> + </element> + </zeroOrMore> + </optional> + </define> + + <define name="capsfcrport"> + <attribute name="type"> + <value>fc_remote_port</value> + </attribute> + + <element name="rport"> + <text/> + </element> + + <element name="wwpn"> + <ref name="wwn"/> + </element> + </define> + + <define name="capscsitarget"> + <attribute name="type"> + <value>scsi_target</value> + </attribute> + + <element name="target"> + <text/> + </element> + + <optional> + <element name="capability"> + <ref name="capsfcrport"/> + </element> + </optional> + </define> + + <define name="capscsi"> + <attribute name="type"> + <value>scsi</value> + </attribute> + + <element name="host"> + <ref name="unsignedLong"/> + </element> + <element name="bus"> + <ref name="unsignedLong"/> + </element> + <element name="target"> + <ref name="unsignedLong"/> + </element> + <element name="lun"> + <ref name="unsignedLong"/> + </element> + + <optional> + <element name="type"> + <text/> + </element> + </optional> + </define> + + <define name="capstorage"> + <attribute name="type"> + <value>storage</value> + </attribute> + + <element name="block"> + <ref name="path"/> + </element> + + <optional> + <element name="bus"> + <text/> + </element> + </optional> + <optional> + <element name="drive_type"> + <text/> + </element> + </optional> + <optional> + <element name="model"> + <text/> + </element> + </optional> + <optional> + <element name="vendor"> + <text/> + </element> + </optional> + <optional> + <element name="serial"> + <text/> + </element> + </optional> + + <choice> + <ref name="capstorageremoveable"/> + <ref name="capstoragefixed"/> + </choice> + + <optional> + <element name="capability"> + <attribute name="type"> + <value>hotpluggable</value> + </attribute> + </element> + </optional> + </define> + + <define name="capstorageremoveable"> + <element name="capability"> + <attribute name="type"> + <value>removable</value> + </attribute> + <element name="media_available"> + <choice> + <value>1</value> + <value>0</value> + </choice> + </element> + + <element name="media_size"> + <ref name="unsignedLong"/> + </element> + <optional> + <element name="media_label"> + <text/> + </element> + </optional> + <ref name="blockData"/> + </element> + </define> + + <define name="capstoragefixed"> + <element name="size"> + <ref name="unsignedLong"/> + </element> + <ref name="blockData"/> + </define> + + <define name="blockData"> + <optional> + <element name="logical_block_size"> + <ref name="unsignedLong"/> + </element> + <element name="num_blocks"> + <ref name="unsignedLong"/> + </element> + </optional> + </define> + + <define name="capdrm"> + <attribute name="type"> + <value>drm</value> + </attribute> + <element name="type"> + <choice> + <value>primary</value> + <value>control</value> + <value>render</value> + </choice> + </element> + </define> + + <define name="capmdev"> + <interleave> + <attribute name="type"> + <value>mdev</value> + </attribute> + <element name="type"> + <attribute name="id"> + <data type="string"/> + </attribute> + </element> + <optional> + <element name="iommuGroup"> + <attribute name="number"> + <ref name="unsignedInt"/> + </attribute> + </element> + </optional> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <optional> + <element name="parent_addr"> + <data type="string"/> + </element> + </optional> + <zeroOrMore> + <element name="attr"> + <attribute name="name"/> + <attribute name="value"/> + </element> + </zeroOrMore> + </interleave> + </define> + + <define name="capccwaddress"> + <interleave> + <element name="cssid"> + <ref name="ccwCssidRange"/> + </element> + <element name="ssid"> + <ref name="ccwSsidRange"/> + </element> + <element name="devno"> + <ref name="ccwDevnoRange"/> + </element> + </interleave> + </define> + + <define name="capccwdev"> + <attribute name="type"> + <value>ccw</value> + </attribute> + <ref name="capccwaddress"/> + </define> + + <define name="capcssdev"> + <attribute name="type"> + <value>css</value> + </attribute> + <interleave> + <ref name="capccwaddress"/> + <optional> + <element name="channel_dev_addr"> + <ref name="capccwaddress"/> + </element> + </optional> + <optional> + <ref name="mdev_types"/> + </optional> + </interleave> + </define> + + <define name="capvdpa"> + <attribute name="type"> + <value>vdpa</value> + </attribute> + <element name="chardev"> + <ref name="path"/> + </element> + </define> + + <define name="capapcard"> + <attribute name="type"> + <value>ap_card</value> + </attribute> + <element name="ap-adapter"> + <ref name="uint8"/> + </element> + </define> + + <define name="capapqueue"> + <attribute name="type"> + <value>ap_queue</value> + </attribute> + <element name="ap-adapter"> + <ref name="uint8"/> + </element> + <element name="ap-domain"> + <ref name="apDomainRange"/> + </element> + </define> + + <define name='capapmatrix'> + <attribute name='type'> + <value>ap_matrix</value> + </attribute> + <optional> + <ref name="mdev_types"/> + </optional> + </define> + + <define name="address"> + <element name="address"> + <attribute name="domain"><ref name="hexuint"/></attribute> + <attribute name="bus"><ref name="hexuint"/></attribute> + <attribute name="slot"><ref name="hexuint"/></attribute> + <attribute name="function"><ref name="hexuint"/></attribute> + </element> + </define> + + <define name="mac"> + <data type="string"> + <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param> + </data> + </define> + + <define name="path"> + <data type="string"> + <param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param> + </data> + </define> + + <define name="mdev_types"> + <element name="capability"> + <attribute name="type"> + <value>mdev_types</value> + </attribute> + <oneOrMore> + <element name="type"> + <attribute name="id"> + <data type="string"/> + </attribute> + <optional> + <element name="name"><text/></element> + </optional> + <element name="deviceAPI"> + <choice> + <value>vfio-pci</value> + <value>vfio-ccw</value> + <value>vfio-ap</value> + </choice> + </element> + <element name="availableInstances"> + <ref name="unsignedInt"/> + </element> + </element> + </oneOrMore> + </element> + </define> + + <define name="vpd"> + <element name="capability"> + <attribute name="type"> + <value>vpd</value> + </attribute> + <element name="name"> + <ref name="vpdFieldValueFormat"/> + </element> + <optional> + <element name="fields"> + <attribute name="access"> + <value>readonly</value> + </attribute> + <optional> + <element name="change_level"> + <ref name="vpdFieldValueFormat"/> + </element> + </optional> + <optional> + <element name="manufacture_id"> + <ref name="vpdFieldValueFormat"/> + </element> + </optional> + <optional> + <element name="part_number"> + <ref name="vpdFieldValueFormat"/> + </element> + </optional> + <optional> + <element name="serial_number"> + <ref name="vpdFieldValueFormat"/> + </element> + </optional> + <zeroOrMore> + <element name="vendor_field"> + <attribute name="index"> + <ref name="vendorVPDFieldIndex"/> + </attribute> + <ref name="vpdFieldValueFormat"/> + </element> + </zeroOrMore> + </element> + </optional> + <optional> + <element name="fields"> + <attribute name="access"> + <value>readwrite</value> + </attribute> + <optional> + <element name="asset_tag"> + <ref name="vpdFieldValueFormat"/> + </element> + </optional> + <zeroOrMore> + <element name="vendor_field"> + <attribute name="index"> + <ref name="vendorVPDFieldIndex"/> + </attribute> + <ref name="vpdFieldValueFormat"/> + </element> + </zeroOrMore> + <zeroOrMore> + <element name="system_field"> + <attribute name="index"> + <ref name="systemVPDFieldIndex"/> + </attribute> + <ref name="vpdFieldValueFormat"/> + </element> + </zeroOrMore> + </element> + </optional> + </element> + </define> + + <define name="apDomainRange"> + <choice> + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,4}</param> + </data> + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">255</param> + </data> + </choice> + </define> + + <define name="vpdFieldValueFormat"> + <data type="string"> + <param name="pattern">.{0,255}</param> + </data> + </define> + + <define name="vendorVPDFieldIndex"> + <data type="string"> + <param name="pattern">[0-9A-Z]{1}</param> + </data> + </define> + + <define name="systemVPDFieldIndex"> + <data type="string"> + <param name="pattern">[0-9B-Z]{1}</param> + </data> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/nwfilter.rng b/src/main/resources/libvirt/rng/nwfilter.rng new file mode 100644 index 0000000..262bd55 --- /dev/null +++ b/src/main/resources/libvirt/rng/nwfilter.rng @@ -0,0 +1,988 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="nwfilter_params.rng"/> + <start> + <ref name="filter"/> + </start> + <define name="filter"> + <element name="filter"> + <interleave> + <ref name="filter-node-attributes"/> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <zeroOrMore> + <choice> + <element name="filterref"> + <ref name="filterref-node-attributes"/> + </element> + <element name="rule"> + <ref name="rule-node-attributes"/> + <choice> + <empty/> + <element name="mac"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="mac-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="vlan"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="vlan-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="stp"> + <ref name="match-attribute"/> + <ref name="srcmacandmask-attributes"/> + <ref name="stp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="arp"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="arp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="rarp"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="arp-attributes"/> <!-- same as arp --> + <ref name="comment-attribute"/> + </element> + <element name="ip"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-port-attributes"/> + <ref name="ip-attributes"/> + <ref name="dscp-attribute"/> + <ref name="comment-attribute"/> + </element> + <element name="ipv6"> + <ref name="match-attribute"/> + <ref name="common-l2-attributes"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-port-attributes"/> + <ref name="ip-attributes"/> + <ref name="icmp-attribute-ranges"/> + <ref name="comment-attribute"/> + </element> + <element name="tcp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="tcp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="udp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="sctp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="icmp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="icmp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="igmp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="all"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="esp"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="ah"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="udplite"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ip-attributes-p1"/> + <ref name="common-ip-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="tcp-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="tcp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="udp-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="sctp-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-port-attributes"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="icmpv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="icmp-attributes"/> + <ref name="comment-attribute"/> + </element> + <element name="all-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="esp-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="ah-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + <element name="udplite-ipv6"> + <ref name="match-attribute"/> + <ref name="srcmac-attribute"/> + <ref name="common-ipv6-attributes-p1"/> + <ref name="common-ipv6-attributes-p2"/> + <ref name="comment-attribute"/> + </element> + </choice> + </element> + </choice> + </zeroOrMore> + </interleave> + </element> + </define> + + <!-- ########### attributes of XML nodes ############ --> + + <define name="filter-node-attributes"> + <attribute name="name"> + <data type="NCName"/> + </attribute> + <optional> + <attribute name="chain"> + <choice> + <value>root</value> + <data type="string"> + <param name="pattern">mac[a-zA-Z0-9_\.:\-]{0,9}</param> + </data> + <data type="string"> + <param name="pattern">stp[a-zA-Z0-9_\.:\-]{0,9}</param> + </data> + <data type="string"> + <param name="pattern">vlan[a-zA-Z0-9_\.:\-]{0,8}</param> + </data> + <data type="string"> + <param name="pattern">arp[a-zA-Z0-9_\.:\-]{0,9}</param> + </data> + <data type="string"> + <param name="pattern">rarp[a-zA-Z0-9_\.:\-]{0,8}</param> + </data> + <data type="string"> + <param name="pattern">ipv4[a-zA-Z0-9_\.:\-]{0,8}</param> + </data> + <data type="string"> + <param name="pattern">ipv6[a-zA-Z0-9_\.:\-]{0,8}</param> + </data> + </choice> + </attribute> + </optional> + <optional> + <attribute name="priority"> + <ref name="priority-type"/> + </attribute> + </optional> + </define> + + <define name="rule-node-attributes"> + <attribute name="action"> + <ref name="action-type"/> + </attribute> + <attribute name="direction"> + <ref name="direction-type"/> + </attribute> + <optional> + <attribute name="priority"> + <ref name="priority-type"/> + </attribute> + </optional> + <optional> + <attribute name="statematch"> + <ref name="statematch-type"/> + </attribute> + </optional> + </define> + + <define name="match-attribute"> + <interleave> + <optional> + <attribute name="match"> + <ref name="virYesNo"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="srcmac-attribute"> + <interleave> + <optional> + <attribute name="srcmacaddr"> + <ref name="addrMAC"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="srcmacandmask-attributes"> + <interleave> + <ref name="srcmac-attribute"/> + <optional> + <attribute name="srcmacmask"> + <ref name="addrMAC"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-l2-attributes"> + <interleave> + <ref name="srcmacandmask-attributes"/> + <optional> + <attribute name="dstmacaddr"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="dstmacmask"> + <ref name="addrMAC"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-ip-attributes-p1"> + <interleave> + <optional> + <attribute name="srcipaddr"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="srcipmask"> + <ref name="addrMask"/> + </attribute> + </optional> + <optional> + <attribute name="dstipaddr"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="dstipmask"> + <ref name="addrMask"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-ip-attributes-p2"> + <interleave> + <optional> + <attribute name="srcipfrom"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="srcipto"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="dstipfrom"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="dstipto"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="dscp"> + <ref name="sixbitrange"/> + </attribute> + </optional> + <optional> + <attribute name="connlimit-above"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="state"> + <ref name="stateflags-type"/> + </attribute> + </optional> + <optional> + <attribute name="ipset"> + <ref name="ipset-name-type"/> + </attribute> + <attribute name="ipsetflags"> + <ref name="ipset-flags-type"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-ipv6-attributes-p1"> + <interleave> + <optional> + <attribute name="srcipaddr"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="srcipmask"> + <ref name="addrMaskv6"/> + </attribute> + </optional> + <optional> + <attribute name="dstipaddr"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="dstipmask"> + <ref name="addrMaskv6"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-ipv6-attributes-p2"> + <interleave> + <optional> + <attribute name="srcipfrom"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="srcipto"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="dstipfrom"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="dstipto"> + <ref name="addrIPv6"/> + </attribute> + </optional> + <optional> + <attribute name="dscp"> + <ref name="sixbitrange"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="common-port-attributes"> + <interleave> + <optional> + <attribute name="srcportstart"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="srcportend"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="dstportstart"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="dstportend"> + <ref name="uint16range"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="icmp-attributes"> + <interleave> + <optional> + <attribute name="type"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="code"> + <ref name="uint8"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="icmp-attribute-ranges"> + <interleave> + <optional> + <attribute name="type"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="typeend"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="code"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="codeend"> + <ref name="uint8"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="mac-attributes"> + <interleave> + <optional> + <attribute name="protocolid"> + <ref name="mac-protocolid"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="vlan-attributes"> + <interleave> + <optional> + <attribute name="vlanid"> + <ref name="vlan-vlanid"/> + </attribute> + </optional> + <optional> + <attribute name="encap-protocol"> + <ref name="mac-protocolid"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="stp-attributes"> + <optional> + <attribute name="type"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="flags"> + <ref name="uint8"/> + </attribute> + </optional> + <optional> + <attribute name="root-priority"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="root-priority-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="root-address"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="root-address-mask"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="root-cost"> + <ref name="uint32range"/> + </attribute> + </optional> + <optional> + <attribute name="root-cost-hi"> + <ref name="uint32range"/> + </attribute> + </optional> + <optional> + <attribute name="sender-priority"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="sender-priority-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="sender-address"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="sender-address-mask"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="port"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="port-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="age"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="age-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="max-age"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="max-age-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="hello-time"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="hello-time-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="forward-delay"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="forward-delay-hi"> + <ref name="uint16range"/> + </attribute> + </optional> + </define> + + <define name="arp-attributes"> + <interleave> + <optional> + <attribute name="arpsrcmacaddr"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="arpsrcipaddr"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="arpdstmacaddr"> + <ref name="addrMAC"/> + </attribute> + </optional> + <optional> + <attribute name="arpdstipaddr"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="hwtype"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="opcode"> + <ref name="arpOpcodeType"/> + </attribute> + </optional> + <optional> + <attribute name="protocoltype"> + <ref name="uint16range"/> + </attribute> + </optional> + <optional> + <attribute name="gratuitous"> + <ref name="boolean"/> + </attribute> + </optional> + </interleave> + </define> + + <define name="ip-attributes"> + <optional> + <attribute name="protocol"> + <ref name="ipProtocolType"/> + </attribute> + </optional> + </define> + + <define name="dscp-attribute"> + <optional> + <attribute name="dscp"> + <ref name="sixbitrange"/> + </attribute> + </optional> + </define> + + <define name="comment-attribute"> + <optional> + <attribute name="comment"> + <ref name="comment-type"/> + </attribute> + </optional> + </define> + + <define name="tcp-attributes"> + <optional> + <attribute name="flags"> + <ref name="tcpflags-type"/> + </attribute> + </optional> + </define> + + <!-- ################ type library ################ --> + + <define name="variable-name-type"> + <data type="string"> + <param name="pattern">$[ ]*[a-zA-Z0-9_]+(\[[ ]*[@]?[0-9]+[ ]*\])?[ ]*</param> + </data> + </define> + + <define name="addrMAC"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">([a-fA-F0-9]{1,2}:){5}[a-fA-F0-9]{1,2}</param> + </data> + </choice> + </define> + + <define name="addrIP"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param> + </data> + </choice> + </define> + + <define name="addrIPv6"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">([a-fA-F0-9]{0,4}:){2,7}([a-fA-F0-9]*)(([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9])?</param> + </data> + </choice> + </define> + + <define name="addrMask"> + <choice> + <ref name="variable-name-type"/> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">32</param> + </data> + + <data type="string"> + <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param> + </data> + </choice> + </define> + + <define name="addrMaskv6"> + <choice> + <ref name="variable-name-type"/> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">128</param> + </data> + + <data type="string"> + <param name="pattern">([a-fA-F0-9]{0,4}:){2,7}([a-fA-F0-9]*)</param> + </data> + </choice> + </define> + + <define name="sixbitrange"> + <choice> + <data type="string"> + <param name="pattern">0x([0-3][0-9a-fA-F]|[0-9a-fA-F])</param> + </data> + + <ref name="variable-name-type"/> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">63</param> + </data> + </choice> + </define> + + <define name="mac-protocolid"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">0x([6-9a-fA-F][0-9a-fA-F]{2}|[0-9a-fA-F]{4})</param> + </data> + + <data type="int"> + <param name="minInclusive">1536</param> + <param name="maxInclusive">65535</param> + </data> + + <choice> + <value>arp</value> + <value>rarp</value> + <value>ipv4</value> + <value>ipv6</value> + <value>vlan</value> + </choice> + </choice> + </define> + + <define name="vlan-vlanid"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">0x([0-9a-fA-F]{1,3})</param> + </data> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">4095</param> + </data> + </choice> + </define> + + <define name="uint16range"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,4}</param> + </data> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">65535</param> + </data> + </choice> + </define> + + <define name="uint32range"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,8}</param> + </data> + + <data type="unsignedInt"/> + </choice> + </define> + + <define name="boolean"> + <choice> + <value>yes</value> + <value>no</value> + <value>true</value> + <value>false</value> + <value>1</value> + <value>0</value> + </choice> + </define> + + <define name="arpOpcodeType"> + <choice> + <ref name="variable-name-type"/> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">65535</param> + </data> + + <data type="string"> + <param name="pattern">([Rr]eply|[Rr]equest|[Rr]equest_[Rr]everse|[Rr]eply_[Rr]everse|DRARP_[Rr]equest|DRARP_[Rr]eply|DRARP_[Ee]rror|InARP_[Rr]equest|ARP_NAK)</param> + </data> + + </choice> + </define> + + <define name="ipProtocolType"> + <choice> + <ref name="variable-name-type"/> + + <data type="string"> + <param name="pattern">0x[0-9a-fA-F]{1,2}</param> + </data> + + <data type="int"> + <param name="minInclusive">0</param> + <param name="maxInclusive">255</param> + </data> + + <choice> + <value>tcp</value> + <value>udp</value> + <value>udplite</value> + <value>esp</value> + <value>ah</value> + <value>icmp</value> + <value>igmp</value> + <value>sctp</value> + <value>icmpv6</value> + </choice> + </choice> + </define> + + <define name="action-type"> + <choice> + <value>drop</value> + <value>accept</value> + <value>reject</value> + <value>continue</value> + <value>return</value> + </choice> + </define> + + <define name="direction-type"> + <choice> + <value>in</value> + <value>out</value> + <value>inout</value> + </choice> + </define> + + <define name="priority-type"> + <data type="int"> + <param name="minInclusive">-1000</param> + <param name="maxInclusive">1000</param> + </data> + </define> + <define name="statematch-type"> + <data type="string"> + <param name="pattern">([Ff][Aa][Ll][Ss][Ee]|0)</param> + </data> + </define> + + <define name="comment-type"> + <data type="string"/> + </define> + + <define name="stateflags-type"> + <data type="string"> + <param name="pattern">((NEW|ESTABLISHED|RELATED|INVALID)(,(NEW|ESTABLISHED|RELATED|INVALID))*|NONE)</param> + </data> + </define> + + <define name="tcpflags-type"> + <data type="string"> + <param name="pattern">((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)/((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)</param> + </data> + </define> + + <define name="ipset-name-type"> + <choice> + <ref name="variable-name-type"/> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.:\-\+ ]{1,31}</param> + </data> + </choice> + </define> + + <define name="ipset-flags-type"> + <data type="string"> + <param name="pattern">([Ss][Rr][Cc]|[Dd][Ss][Tt])(,([Ss][Rr][Cc]|[Dd][Ss][Tt])){0,5}</param> + </data> + </define> +</grammar> diff --git a/src/main/resources/libvirt/rng/nwfilter_params.rng b/src/main/resources/libvirt/rng/nwfilter_params.rng new file mode 100644 index 0000000..a3e7b35 --- /dev/null +++ b/src/main/resources/libvirt/rng/nwfilter_params.rng @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- network-related definitions used in multiple grammars --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <define name="filterref-node-attributes"> + <attribute name="filter"> + <data type="NCName"/> + </attribute> + <zeroOrMore> + <element name="parameter"> + <attribute name="name"> + <ref name="filter-param-name"/> + </attribute> + <attribute name="value"> + <ref name="filter-param-value"/> + </attribute> + </element> + </zeroOrMore> + </define> + + <define name="filter-param-name"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_]+</param> + </data> + </define> + <define name="filter-param-value"> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.:]+</param> + </data> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/nwfilterbinding.rng b/src/main/resources/libvirt/rng/nwfilterbinding.rng new file mode 100644 index 0000000..c91312b --- /dev/null +++ b/src/main/resources/libvirt/rng/nwfilterbinding.rng @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <!-- domain-related definitions used in multiple grammars --> + <include href="basictypes.rng"/> + <include href="nwfilter_params.rng"/> + + <start> + <ref name="filterbinding"/> + </start> + + <define name="filterbinding"> + <element name="filterbinding"> + <interleave> + <element name="owner"> + <interleave> + <element name="name"> + <text/> + </element> + <element name="uuid"> + <ref name="UUID"/> + </element> + </interleave> + </element> + + <element name="portdev"> + <attribute name="name"/> + <empty/> + </element> + + <optional> + <element name="linkdev"> + <attribute name="name"/> + <empty/> + </element> + </optional> + + <element name="mac"> + <attribute name="address"> + <ref name="uniMacAddr"/> + </attribute> + <empty/> + </element> + + <element name="filterref"> + <ref name="filterref-node-attributes"/> + </element> + </interleave> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/privatedata.rng b/src/main/resources/libvirt/rng/privatedata.rng new file mode 100644 index 0000000..3955193 --- /dev/null +++ b/src/main/resources/libvirt/rng/privatedata.rng @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- This schema is provides scaffolding for having proper schema for private + data elements used by libvirt internally. + + Public schema must not implement any of the defines below. + + To override the definitions below use: + + <define name="..." combine="choice"> + --> + + <define name="privateDataStorageSource"> + <optional> + <element name="privateData"> + <notAllowed/> + </element> + </optional> + </define> + + <define name="privateDataDeviceDisk"> + <optional> + <element name="privateData"> + <notAllowed/> + </element> + </optional> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/secret.rng b/src/main/resources/libvirt/rng/secret.rng new file mode 100644 index 0000000..c90e2eb --- /dev/null +++ b/src/main/resources/libvirt/rng/secret.rng @@ -0,0 +1,94 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt secret properties XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + <start> + <ref name="secret"/> + </start> + + <include href="basictypes.rng"/> + + <define name="secret"> + <element name="secret"> + <optional> + <attribute name="ephemeral"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <attribute name="private"> + <ref name="virYesNo"/> + </attribute> + </optional> + <interleave> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + <optional> + <element name="description"> + <text/> + </element> + </optional> + <optional> + <element name="usage"> + <choice> + <ref name="usagevolume"/> + <ref name="usageceph"/> + <ref name="usageiscsi"/> + <ref name="usagetls"/> + <ref name="usagevtpm"/> + <!-- More choices later --> + </choice> + </element> + </optional> + </interleave> + </element> + </define> + + <define name="usagevolume"> + <attribute name="type"> + <value>volume</value> + </attribute> + <element name="volume"> + <ref name="absFilePath"/> + </element> + </define> + + <define name="usageceph"> + <attribute name="type"> + <value>ceph</value> + </attribute> + <element name="name"> + <ref name="objectName"/> + </element> + </define> + + <define name="usageiscsi"> + <attribute name="type"> + <value>iscsi</value> + </attribute> + <element name="target"> + <ref name="objectName"/> + </element> + </define> + + <define name="usagetls"> + <attribute name="type"> + <value>tls</value> + </attribute> + <element name="name"> + <ref name="objectName"/> + </element> + </define> + + <define name="usagevtpm"> + <attribute name="type"> + <value>vtpm</value> + </attribute> + <element name="name"> + <ref name="objectName"/> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/storagecommon.rng b/src/main/resources/libvirt/rng/storagecommon.rng new file mode 100644 index 0000000..14704c7 --- /dev/null +++ b/src/main/resources/libvirt/rng/storagecommon.rng @@ -0,0 +1,273 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for common libvirt XML storage elements --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + + <!-- This schema is not designed for standalone use; another file + must include both this file and basictypes.rng --> + + <define name="encryption"> + <element name="encryption"> + <attribute name="format"> + <choice> + <value>default</value> + <value>qcow</value> + <value>luks</value> + <value>luks2</value> + <value>luks-any</value> + </choice> + </attribute> + <optional> + <attribute name="engine"> + <choice> + <value>qemu</value> + <value>librbd</value> + </choice> + </attribute> + </optional> + <optional> + <interleave> + <oneOrMore> + <ref name="secret"/> + </oneOrMore> + <optional> + <interleave> + <element name="cipher"> + <ref name="keycipher"/> + </element> + <element name="ivgen"> + <ref name="keyivgen"/> + </element> + </interleave> + </optional> + </interleave> + </optional> + </element> + </define> + + <define name="initiatorinfo"> + <element name="initiator"> + <element name="iqn"> + <attribute name="name"> + <text/> + </attribute> + <empty/> + </element> + </element> + </define> + + <define name="reconnect"> + <element name="reconnect"> + <choice> + <group> + <attribute name="enabled"> + <ref name="virYesNo"/> + </attribute> + <optional> + <attribute name="timeout"> + <ref name="unsignedInt"/> + </attribute> + </optional> + </group> + <attribute name="delay"> + <ref name="unsignedInt"/> + </attribute> + </choice> + </element> + </define> + + <define name="unixSocketSource"> + <element name="source"> + <attribute name="type"> + <value>unix</value> + </attribute> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + <attribute name="mode"> + <choice> + <value>server</value> + <value>client</value> + </choice> + </attribute> + <optional> + <ref name="reconnect"/> + </optional> + <empty/> + </element> + </define> + + <define name="reservations"> + <element name="reservations"> + <optional> + <attribute name="managed"> + <ref name="virYesNo"/> + </attribute> + </optional> + <optional> + <ref name="unixSocketSource"/> + </optional> + </element> + </define> + + <define name="secret"> + <element name="secret"> + <attribute name="type"> + <value>passphrase</value> + </attribute> + <choice> + <attribute name="uuid"> + <ref name="UUID"/> + </attribute> + <attribute name="usage"> + <text/> + </attribute> + </choice> + </element> + </define> + + <define name="compat"> + <element name="compat"> + <data type="string"> + <param name="pattern">[0-9]+\.[0-9]+</param> + </data> + </element> + </define> + + <define name="clusterSize"> + <element name="clusterSize"> + <ref name="scaledInteger"/> + </element> + </define> + + <define name="fileFormatFeatures"> + <element name="features"> + <interleave> + <optional> + <element name="lazy_refcounts"> + <empty/> + </element> + </optional> + <optional> + <element name="extended_l2"> + <empty/> + </element> + </optional> + </interleave> + </element> + </define> + + <!-- split the list of known storage formats into two, those where + we know how to follow backing chains, and all others --> + <define name="storageFormatBacking"> + <choice> + <value>cow</value> + <value>qcow</value> + <value>qcow2</value> + <value>qed</value> + <value>vmdk</value> + </choice> + </define> + <define name="storageFormat"> + <choice> + <value>raw</value> + <value>dir</value> + <value>bochs</value> + <value>cloop</value> + <value>dmg</value> + <value>iso</value> + <value>vpc</value> + <value>vdi</value> + <value>fat</value> + <value>vhd</value> + <value>ploop</value> + <value>luks</value> + <ref name="storageFormatBacking"/> + </choice> + </define> + + <define name="storageStartupPolicy"> + <!-- Use a combine="choice" override in client files that want to + add additional attributes to a <source> sub-element + associated with a storage source --> + <notAllowed/> + </define> + + <define name="storageSourceExtra"> + <!-- Use a combine="choice" override in client files that want to + add additional elements as siblings of a <source> sub-element + associated with a storage source --> + <notAllowed/> + </define> + + <define name="permissions"> + <optional> + <element name="permissions"> + <interleave> + <optional> + <element name="mode"> + <ref name="octalMode"/> + </element> + </optional> + <optional> + <element name="owner"> + <choice> + <ref name="unsignedInt"/> + <value>-1</value> + </choice> + </element> + </optional> + <optional> + <element name="group"> + <choice> + <ref name="unsignedInt"/> + <value>-1</value> + </choice> + </element> + </optional> + <optional> + <element name="label"> + <text/> + </element> + </optional> + </interleave> + </element> + </optional> + </define> + + <define name="keycipher"> + <attribute name="name"> + <text/> + </attribute> + <attribute name="size"> + <ref name="unsignedInt"/> + </attribute> + <optional> + <attribute name="mode"> + <text/> + </attribute> + <attribute name="hash"> + <text/> + </attribute> + </optional> + </define> + + <define name="keyivgen"> + <attribute name="name"> + <text/> + </attribute> + <optional> + <attribute name="hash"> + <text/> + </attribute> + </optional> + </define> + + <define name="refreshVolumeAllocation"> + <choice> + <value>default</value> + <value>capacity</value> + </choice> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/storagepool.rng b/src/main/resources/libvirt/rng/storagepool.rng new file mode 100644 index 0000000..63a8b75 --- /dev/null +++ b/src/main/resources/libvirt/rng/storagepool.rng @@ -0,0 +1,786 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt storage pool XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <include href="storagecommon.rng"/> + <start> + <ref name="pool"/> + </start> + + + <define name="pool"> + <element name="pool"> + <choice> + <ref name="pooldir"/> + <ref name="poolfs"/> + <ref name="poolnetfs"/> + <ref name="poollogical"/> + <ref name="pooldisk"/> + <ref name="pooliscsi"/> + <ref name="pooliscsidirect"/> + <ref name="poolscsi"/> + <ref name="poolmpath"/> + <ref name="poolrbd"/> + <ref name="poolsheepdog"/> + <ref name="poolgluster"/> + <ref name="poolzfs"/> + <ref name="poolvstorage"/> + </choice> + </element> + </define> + + <define name="pooldir"> + <attribute name="type"> + <value>dir</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcedir"/> + <ref name="target"/> + </interleave> + </define> + + <define name="poolfs"> + <attribute name="type"> + <value>fs</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcefs"/> + <ref name="target"/> + </interleave> + <optional> + <ref name="fs_mount_opts"/> + </optional> + </define> + + <define name="poolnetfs"> + <attribute name="type"> + <value>netfs</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcenetfs"/> + <ref name="target"/> + <optional> + <ref name="fs_mount_opts"/> + </optional> + </interleave> + </define> + + <define name="poollogical"> + <attribute name="type"> + <value>logical</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcelogical"/> + <ref name="targetlogical"/> + </interleave> + </define> + + <define name="pooldisk"> + <attribute name="type"> + <value>disk</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcedisk"/> + <ref name="target"/> + </interleave> + </define> + + <define name="pooliscsi"> + <attribute name="type"> + <value>iscsi</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourceiscsi"/> + <ref name="target"/> + </interleave> + </define> + + <define name="pooliscsidirect"> + <attribute name="type"> + <value>iscsi-direct</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <optional> + <ref name="sizing"/> + </optional> + <ref name="features"/> + <ref name="sourceiscsidirect"/> + </interleave> + </define> + + <define name="poolscsi"> + <attribute name="type"> + <value>scsi</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcescsi"/> + <ref name="target"/> + </interleave> + </define> + + <define name="poolmpath"> + <attribute name="type"> + <value>mpath</value> + </attribute> + <interleave> + <ref name="commonmetadata"/> + <ref name="sizing"/> + <ref name="features"/> + <optional> + <ref name="sourcempath"/> + </optional> + <ref name="target"/> + </interleave> + </define> + + <define name="poolrbd"> + <attribute name="type"> + <value>rbd</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcerbd"/> + <ref name="refresh"/> + <optional> + <ref name="rbd_config_opts"/> + </optional> + </interleave> + </define> + + <define name="poolsheepdog"> + <attribute name="type"> + <value>sheepdog</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcesheepdog"/> + </interleave> + </define> + + <define name="poolgluster"> + <attribute name="type"> + <value>gluster</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcegluster"/> + </interleave> + </define> + + <define name="poolzfs"> + <attribute name="type"> + <value>zfs</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcezfs"/> + <optional> + <ref name="target"/> + </optional> + </interleave> + </define> + + <define name="poolvstorage"> + <attribute name="type"> + <value>vstorage</value> + </attribute> + <interleave> + <ref name="commonMetadataNameOptional"/> + <ref name="sizing"/> + <ref name="features"/> + <ref name="sourcevstorage"/> + <ref name="target"/> + </interleave> + </define> + + <define name="sourceinfovendor"> + <interleave> + <optional> + <element name="vendor"> + <attribute name="name"> + <text/> + </attribute> + </element> + </optional> + <optional> + <element name="product"> + <attribute name="name"> + <text/> + </attribute> + </element> + </optional> + </interleave> + </define> + + <define name="commonMetadataNameOptional"> + <interleave> + <optional> + <element name="name"> + <ref name="objectName"/> + </element> + </optional> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + </interleave> + </define> + + <define name="commonmetadata"> + <interleave> + <element name="name"> + <ref name="objectName"/> + </element> + <optional> + <element name="uuid"> + <ref name="UUID"/> + </element> + </optional> + </interleave> + </define> + + <define name="sizing"> + <interleave> + <optional> + <element name="capacity"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="allocation"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="available"> + <ref name="scaledInteger"/> + </element> + </optional> + </interleave> + </define> + + <define name="features"> + <optional> + <element name="features"> + <interleave> + <optional> + <element name="cow"> + <attribute name="state"> + <ref name="virYesNo"/> + </attribute> + </element> + </optional> + </interleave> + </element> + </optional> + </define> + + <define name="target"> + <element name="target"> + <interleave> + <element name="path"> + <ref name="absFilePath"/> + </element> + <ref name="permissions"/> + </interleave> + </element> + </define> + + <define name="targetlogical"> + <element name="target"> + <interleave> + <optional> + <element name="path"> + <ref name="absFilePath"/> + </element> + </optional> + <ref name="permissions"/> + </interleave> + </element> + </define> + + <define name="sourceinfohost"> + <oneOrMore> + <element name="host"> + <attribute name="name"> + <choice> + <ref name="dnsName"/> + <ref name="ipAddr"/> + </choice> + </attribute> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <empty/> + </element> + </oneOrMore> + </define> + + <define name="sourceinfodev"> + <element name="device"> + <attribute name="path"> + <choice> + <ref name="absFilePath"/> + <ref name="genericName"/> + <ref name="IscsiQualifiedName"/> + </choice> + </attribute> + <choice> + <empty/> + <ref name="devextents"/> + </choice> + <optional> + <attribute name="part_separator"> + <ref name="virYesNo"/> + </attribute> + </optional> + </element> + </define> + + <define name="sourceinfodeviscsidirect"> + <element name="device"> + <attribute name="path"> + <ref name="IscsiQualifiedName"/> + </attribute> + </element> + </define> + + <define name="devextents"> + <oneOrMore> + <element name="freeExtent"> + <attribute name="start"> + <ref name="unsignedLong"/> + </attribute> + <attribute name="end"> + <ref name="unsignedLong"/> + </attribute> + </element> + </oneOrMore> + </define> + + <define name="sourceinfodir"> + <element name="dir"> + <attribute name="path"> + <ref name="absDirPath"/> + </attribute> + <empty/> + </element> + </define> + + <define name="sourceinfonetrelativepath"> + <element name="dir"> + <attribute name="path"> + <ref name="dirPath"/> + </attribute> + <empty/> + </element> + </define> + + <define name="sourceinfoname"> + <element name="name"> + <text/> + </element> + </define> + + <define name="sourceinfoauth"> + <element name="auth"> + <attribute name="type"> + <choice> + <value>chap</value> + <value>ceph</value> + </choice> + </attribute> + <attribute name="username"> + <text/> + </attribute> + <ref name="sourceinfoauthsecret"/> + </element> + </define> + + <define name="sourceinfoauthsecret"> + <element name="secret"> + <choice> + <attribute name="uuid"> + <text/> + </attribute> + <attribute name="usage"> + <text/> + </attribute> + </choice> + </element> + </define> + + <define name="sourcezfs"> + <element name="source"> + <interleave> + <ref name="sourceinfoname"/> + <optional> + <ref name="sourceinfodev"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcevstorage"> + <element name="source"> + <interleave> + <ref name="sourceinfoname"/> + </interleave> + </element> + </define> + + <define name="sourcefmtfs"> + <optional> + <element name="format"> + <attribute name="type"> + <choice> + <value>auto</value> + <value>ext2</value> + <value>ext3</value> + <value>ext4</value> + <value>ufs</value> + <value>iso9660</value> + <value>udf</value> + <value>gfs</value> + <value>gfs2</value> + <value>vfat</value> + <value>hfs+</value> + <value>xfs</value> + <value>ocfs2</value> + <value>vmfs</value> + </choice> + </attribute> + </element> + </optional> + </define> + + + <define name="sourcefmtnetfs"> + <optional> + <element name="format"> + <attribute name="type"> + <choice> + <value>auto</value> + <value>nfs</value> + </choice> + </attribute> + </element> + </optional> + </define> + + + <define name="sourcefmtdisk"> + <optional> + <element name="format"> + <attribute name="type"> + <choice> + <value>unknown</value> + <value>dos</value> + <value>dvh</value> + <value>gpt</value> + <value>mac</value> + <value>bsd</value> + <value>pc98</value> + <value>sun</value> + <value>lvm2</value> + </choice> + </attribute> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </element> + </optional> + </define> + + + <define name="sourcefmtlogical"> + <optional> + <element name="format"> + <attribute name="type"> + <choice> + <value>unknown</value> <!-- back-compat requires keeping "unknown" not "auto" --> + <value>lvm2</value> + </choice> + </attribute> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </element> + </optional> + </define> + + + <define name="sourcedir"> + <optional> + <element name="source"> + <empty/> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </element> + </optional> + </define> + + <define name="sourcefs"> + <element name="source"> + <interleave> + <ref name="sourceinfodev"/> + <ref name="sourcefmtfs"/> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcenetfs"> + <element name="source"> + <choice> + <group> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfodir"/> + <ref name="sourcefmtnetfs"/> + <optional> + <element name="protocol"> + <attribute name="ver"/> + </element> + </optional> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </group> + <group> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfonetrelativepath"/> + <element name="format"> + <attribute name="type"> + <choice> + <value>cifs</value> + <value>glusterfs</value> + </choice> + </attribute> + </element> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </group> + </choice> + </element> + </define> + + <define name="sourcelogical"> + <element name="source"> + <interleave> + <oneOrMore> + <optional> + <ref name="sourceinfoname"/> + </optional> + <optional> + <ref name="sourceinfodev"/> + </optional> + </oneOrMore> + <ref name="sourcefmtlogical"/> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcedisk"> + <element name="source"> + <interleave> + <ref name="sourceinfodev"/> + <ref name="sourcefmtdisk"/> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourceiscsi"> + <element name="source"> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfodev"/> + <optional> + <ref name="initiatorinfo"/> + </optional> + <optional> + <ref name="sourceinfoauth"/> + </optional> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourceiscsidirect"> + <element name="source"> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfodeviscsidirect"/> + <ref name="initiatorinfo"/> + <optional> + <ref name="sourceinfoauth"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcescsi"> + <element name="source"> + <interleave> + <ref name="sourceinfoadapter"/> + <optional> + <ref name="sourceinfovendor"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcempath"> + <element name="source"> + <empty/> + </element> + </define> + + <define name="sourcerbd"> + <element name="source"> + <interleave> + <ref name="sourceinfoname"/> + <ref name="sourceinfohost"/> + <optional> + <ref name="sourceinfoauth"/> + </optional> + </interleave> + </element> + </define> + + <define name="sourcesheepdog"> + <element name="source"> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfoname"/> + </interleave> + </element> + </define> + + <define name="sourcegluster"> + <element name="source"> + <interleave> + <ref name="sourceinfohost"/> + <ref name="sourceinfoname"/> + <optional> + <ref name="sourceinfodir"/> + </optional> + </interleave> + </element> + </define> + + <define name="IscsiQualifiedName"> + <data type="string"> + <param name="pattern">iqn\.[0-9]{4}-(0[1-9]|1[0-2])\.[a-zA-Z0-9\.\-]+(:.+)?</param> + </data> + </define> + + <define name="refresh"> + <optional> + <element name="refresh"> + <interleave> + <ref name="refreshVolume"/> + </interleave> + </element> + </optional> + </define> + + <define name="refreshVolume"> + <optional> + <element name="volume"> + <optional> + <attribute name="allocation"> + <ref name="refreshVolumeAllocation"/> + </attribute> + </optional> + </element> + </optional> + </define> + + <!-- + Optional storage pool extensions in their own namespace: + "fs" or "netfs" + --> + + <define name="fs_mount_opts"> + <element name="mount_opts" ns="http://libvirt.org/schemas/storagepool/fs/1.0"> + <zeroOrMore> + <element name="option"> + <attribute name="name"> + <text/> + </attribute> + </element> + </zeroOrMore> + </element> + </define> + + <!-- + Optional storage pool extensions in their own namespace: + RBD + --> + + <define name="rbd_config_opts"> + <element name="config_opts" ns="http://libvirt.org/schemas/storagepool/rbd/1.0"> + <zeroOrMore> + <element name="option"> + <attribute name="name"> + <text/> + </attribute> + <attribute name="value"> + <text/> + </attribute> + </element> + </zeroOrMore> + </element> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/storagepoolcaps.rng b/src/main/resources/libvirt/rng/storagepoolcaps.rng new file mode 100644 index 0000000..ec65fba --- /dev/null +++ b/src/main/resources/libvirt/rng/storagepoolcaps.rng @@ -0,0 +1,88 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt storage pool capabilities XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <start> + <ref name="storagepoolCapabilities"/> + </start> + + + <define name="storagepoolCapabilities"> + <element name="storagepoolCapabilities"> + <zeroOrMore> + <ref name="poolCapsType"/> + </zeroOrMore> + </element> + </define> + + <define name="poolCapsType"> + <element name="pool"> + <ref name="poolCapsTypes"/> + <ref name="poolCapsSupported"/> + <optional> + <ref name="poolCapsPoolOptions"/> + </optional> + <optional> + <ref name="poolCapsVolOptions"/> + </optional> + </element> + </define> + + <define name="poolCapsTypes"> + <attribute name="type"> + <text/> + </attribute> + </define> + + <define name="poolCapsSupported"> + <attribute name="supported"> + <ref name="virYesNo"/> + </attribute> + </define> + + <define name="poolCapsPoolOptions"> + <element name="poolOptions"> + <optional> + <ref name="poolDefaultFormat"/> + </optional> + <optional> + <ref name="poolCapsEnum"/> + </optional> + </element> + </define> + + <define name="poolCapsVolOptions"> + <element name="volOptions"> + <ref name="poolDefaultFormat"/> + <ref name="poolCapsEnum"/> + </element> + </define> + + <define name="poolDefaultFormat"> + <element name="defaultFormat"> + <attribute name="type"> + <text/> + </attribute> + </element> + </define> + + <define name="poolCapsEnum"> + <zeroOrMore> + <element name="enum"> + <attribute name="name"> + <text/> + </attribute> + <ref name="value"/> + </element> + </zeroOrMore> + </define> + + <define name="value"> + <zeroOrMore> + <element name="value"> + <text/> + </element> + </zeroOrMore> + </define> + +</grammar> diff --git a/src/main/resources/libvirt/rng/storagevol.rng b/src/main/resources/libvirt/rng/storagevol.rng new file mode 100644 index 0000000..3e0f482 --- /dev/null +++ b/src/main/resources/libvirt/rng/storagevol.rng @@ -0,0 +1,238 @@ +<?xml version="1.0"?> +<!-- A Relax NG schema for the libvirt storage volume XML format --> +<grammar xmlns="http://relaxng.org/ns/structure/1.0" + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <include href="basictypes.rng"/> + <start> + <ref name="vol"/> + </start> + + <include href="storagecommon.rng"/> + + + <define name="vol"> + <element name="volume"> + <optional> + <attribute name="type"> + <choice> + <value>file</value> + <value>block</value> + <value>dir</value> + <value>network</value> + <value>netdir</value> + </choice> + </attribute> + </optional> + <interleave> + <element name="name"> + <ref name="volName"/> + </element> + <optional> + <element name="key"> + <text/> + </element> + </optional> + <optional> + <ref name="source"/> + </optional> + <ref name="sizing"/> + <ref name="target"/> + <optional> + <ref name="backingStore"/> + </optional> + </interleave> + </element> + </define> + + <define name="sizing"> + <interleave> + <optional> + <element name="capacity"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="allocation"> + <ref name="scaledInteger"/> + </element> + </optional> + <optional> + <element name="physical"> + <ref name="scaledInteger"/> + </element> + </optional> + </interleave> + </define> + + <define name="timestamps"> + <optional> + <element name="timestamps"> + <interleave> + <optional> + <element name="atime"> + <ref name="timestamp"/> + </element> + </optional> + <optional> + <element name="btime"> + <ref name="timestamp"/> + </element> + </optional> + <optional> + <element name="ctime"> + <ref name="timestamp"/> + </element> + </optional> + <optional> + <element name="mtime"> + <ref name="timestamp"/> + </element> + </optional> + </interleave> + </element> + </optional> + </define> + + <define name="timestamp"> + <data type="string"> + <param name="pattern">[0-9]+(\.[0-9]{0,9})?</param> + </data> + </define> + + <define name="target"> + <element name="target"> + <interleave> + <optional> + <element name="path"> + <choice> + <data type="anyURI"/> + <ref name="absFilePath"/> + </choice> + </element> + </optional> + <ref name="format"/> + <ref name="permissions"/> + <ref name="timestamps"/> + <optional> + <ref name="encryption"/> + </optional> + <optional> + <ref name="compat"/> + </optional> + <optional> + <element name="nocow"> + <empty/> + </element> + </optional> + <optional> + <ref name="clusterSize"/> + </optional> + <optional> + <ref name="fileFormatFeatures"/> + </optional> + </interleave> + </element> + </define> + + <define name="backingStore"> + <element name="backingStore"> + <interleave> + <element name="path"> + <ref name="absFilePath"/> + </element> + <ref name="format"/> + <ref name="permissions"/> + <ref name="timestamps"/> + </interleave> + </element> + </define> + + + <define name="source"> + <element name="source"> + <zeroOrMore> + <ref name="sourcedev"/> + </zeroOrMore> + </element> + </define> + + <define name="sourcedev"> + <element name="device"> + <attribute name="path"> + <ref name="absFilePath"/> + </attribute> + <choice> + <empty/> + <ref name="devextents"/> + </choice> + </element> + </define> + + <define name="devextents"> + <oneOrMore> + <element name="extent"> + <attribute name="start"> + <ref name="unsignedLong"/> + </attribute> + <attribute name="end"> + <ref name="unsignedLong"/> + </attribute> + </element> + </oneOrMore> + </define> + + <define name="formatdev"> + <choice> + <value>none</value> + <value>auto</value> + <value>ext2</value> + <value>ext3</value> + <value>ext4</value> + <value>ufs</value> + <value>iso9660</value> + <value>udf</value> + <value>gfs</value> + <value>gfs2</value> + <value>vfat</value> + <value>hfs+</value> + <value>xfs</value> + <value>ocfs2</value> + <value>vmfs</value> + </choice> + </define> + + <define name="formatfile"> + <choice> + <value>unknown</value> + <ref name="storageFormat"/> + </choice> + </define> + + <define name="formatdisk"> + <choice> + <value>none</value> + <value>linux</value> + <value>fat16</value> + <value>fat32</value> + <value>linux-swap</value> + <value>linux-lvm</value> + <value>linux-raid</value> + <value>extended</value> + </choice> + </define> + + <define name="format"> + <optional> + <element name="format"> + <attribute name="type"> + <choice> + <ref name="formatfile"/> + <ref name="formatdev"/> + <ref name="formatdisk"/> + </choice> + </attribute> + </element> + </optional> + </define> + +</grammar> |