2011-06-26 09:13:10 +00:00
|
|
|
<?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>
|
xml: share 'unit' in RNG
The code supported unit='E' for "exabyte", but the RNG did not;
conversely, the RNG supported "z" and "y" but the code did not
(I'm jealous if you have that much storage, particularly since
it won't fit in 64-bit off_t). Also, the code supported
<allocation unit='...'>, but not the RNG.
In an effort to make 'unit' more worthwhile in future patches,
it's easier to share it between files.
In making this factorization, note that absFilePath is more
permissive than 'path', so storage pools and storage volumes
will now validate with a wider set of file names than before.
I don't think this should be a problem in practice.
* docs/schemas/storagepool.rng: Include basic types, rather than
repeating things here.
* docs/schemas/storagevol.rng: Likewise.
* docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
to match storage code.
2012-02-29 04:16:28 +00:00
|
|
|
<define name='unsignedLong'>
|
|
|
|
<data type='unsignedLong'>
|
|
|
|
<param name='pattern'>[0-9]+</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
2011-06-26 09:13:10 +00:00
|
|
|
|
|
|
|
<define name="positiveInteger">
|
|
|
|
<data type="positiveInteger">
|
|
|
|
<param name="pattern">[0-9]+</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="uint8range">
|
|
|
|
<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="uint24range">
|
|
|
|
<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="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>
|
|
|
|
|
2012-08-16 15:41:41 +00:00
|
|
|
<define name="pciaddress">
|
|
|
|
<optional>
|
|
|
|
<attribute name="domain">
|
|
|
|
<ref name="pciDomain"/>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
<attribute name="bus">
|
|
|
|
<ref name="pciBus"/>
|
|
|
|
</attribute>
|
|
|
|
<attribute name="slot">
|
|
|
|
<ref name="pciSlot"/>
|
|
|
|
</attribute>
|
|
|
|
<attribute name="function">
|
|
|
|
<ref name="pciFunc"/>
|
|
|
|
</attribute>
|
|
|
|
<optional>
|
|
|
|
<attribute name="multifunction">
|
|
|
|
<choice>
|
|
|
|
<value>on</value>
|
|
|
|
<value>off</value>
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
</define>
|
|
|
|
|
2011-06-26 09:13:10 +00:00
|
|
|
<!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" -->
|
2012-03-19 16:49:17 +00:00
|
|
|
<!-- 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>
|
2011-06-26 09:13:10 +00:00
|
|
|
<define name="macAddr">
|
|
|
|
<data type="string">
|
2012-03-19 16:49:17 +00:00
|
|
|
<param name="pattern">[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5}</param>
|
2011-06-26 09:13:10 +00:00
|
|
|
</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 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>
|
|
|
|
|
2011-10-28 21:19:34 +00:00
|
|
|
<define name="genericName">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
2011-06-26 09:13:10 +00:00
|
|
|
<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="filePath">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">[a-zA-Z0-9_\.\+\-\\&"'<>/%]+</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="absFilePath">
|
|
|
|
<data type="string">
|
2012-03-09 19:13:30 +00:00
|
|
|
<param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%,]+</param>
|
2011-06-26 09:13:10 +00:00
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name="absDirPath">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">/[a-zA-Z0-9_\.\+\-\\&"'<>/%]*</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
xml: share 'unit' in RNG
The code supported unit='E' for "exabyte", but the RNG did not;
conversely, the RNG supported "z" and "y" but the code did not
(I'm jealous if you have that much storage, particularly since
it won't fit in 64-bit off_t). Also, the code supported
<allocation unit='...'>, but not the RNG.
In an effort to make 'unit' more worthwhile in future patches,
it's easier to share it between files.
In making this factorization, note that absFilePath is more
permissive than 'path', so storage pools and storage volumes
will now validate with a wider set of file names than before.
I don't think this should be a problem in practice.
* docs/schemas/storagepool.rng: Include basic types, rather than
repeating things here.
* docs/schemas/storagevol.rng: Likewise.
* docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
to match storage code.
2012-02-29 04:16:28 +00:00
|
|
|
<define name='unit'>
|
|
|
|
<data type='string'>
|
2012-03-05 21:06:33 +00:00
|
|
|
<param name='pattern'>([bB]([yY][tT][eE][sS]?)?)|([kKmMgGtTpPeE]([iI]?[bB])?)</param>
|
xml: share 'unit' in RNG
The code supported unit='E' for "exabyte", but the RNG did not;
conversely, the RNG supported "z" and "y" but the code did not
(I'm jealous if you have that much storage, particularly since
it won't fit in 64-bit off_t). Also, the code supported
<allocation unit='...'>, but not the RNG.
In an effort to make 'unit' more worthwhile in future patches,
it's easier to share it between files.
In making this factorization, note that absFilePath is more
permissive than 'path', so storage pools and storage volumes
will now validate with a wider set of file names than before.
I don't think this should be a problem in practice.
* docs/schemas/storagepool.rng: Include basic types, rather than
repeating things here.
* docs/schemas/storagevol.rng: Likewise.
* docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
to match storage code.
2012-02-29 04:16:28 +00:00
|
|
|
</data>
|
|
|
|
</define>
|
2012-02-23 00:48:38 +00:00
|
|
|
<define name='scaledInteger'>
|
|
|
|
<optional>
|
|
|
|
<attribute name='unit'>
|
|
|
|
<ref name='unit'/>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
|
|
|
<ref name='unsignedLong'/>
|
|
|
|
</define>
|
xml: share 'unit' in RNG
The code supported unit='E' for "exabyte", but the RNG did not;
conversely, the RNG supported "z" and "y" but the code did not
(I'm jealous if you have that much storage, particularly since
it won't fit in 64-bit off_t). Also, the code supported
<allocation unit='...'>, but not the RNG.
In an effort to make 'unit' more worthwhile in future patches,
it's easier to share it between files.
In making this factorization, note that absFilePath is more
permissive than 'path', so storage pools and storage volumes
will now validate with a wider set of file names than before.
I don't think this should be a problem in practice.
* docs/schemas/storagepool.rng: Include basic types, rather than
repeating things here.
* docs/schemas/storagevol.rng: Likewise.
* docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
to match storage code.
2012-02-29 04:16:28 +00:00
|
|
|
|
2012-08-16 15:41:41 +00:00
|
|
|
<define name="pciDomain">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
<define name="pciBus">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
<define name="pciSlot">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">(0x)?[0-1]?[0-9a-fA-F]</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
<define name="pciFunc">
|
|
|
|
<data type="string">
|
|
|
|
<param name="pattern">(0x)?[0-7]</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
2012-09-11 08:57:01 +00:00
|
|
|
<define name='wwn'>
|
|
|
|
<data type='string'>
|
|
|
|
<param name='pattern'>[0-9a-fA-F]{16}</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
2011-06-26 09:13:10 +00:00
|
|
|
</grammar>
|