* docs/libvirt.rng: went through the existing tests with the RNG and

fixed or added a number constructs
Daniel
This commit is contained in:
Daniel Veillard 2007-01-10 10:08:06 +00:00
parent c642103f6d
commit 4dce3d8fd4
2 changed files with 162 additions and 42 deletions

View File

@ -1,3 +1,8 @@
Wed Jan 10 11:06:36 CET 2007 Daniel Veillard <veillard@redhat.com>
* docs/libvirt.rng: went through the existing tests with the RNG and
fixed or added a number constructs
Tue Jan 9 17:28:18 CET 2007 Daniel Veillard <veillard@redhat.com> Tue Jan 9 17:28:18 CET 2007 Daniel Veillard <veillard@redhat.com>
* docs/libvirt.rng: first version of the Relax-NG schemas to validate * docs/libvirt.rng: first version of the Relax-NG schemas to validate

View File

@ -10,8 +10,8 @@
We handle only document defining a domain We handle only document defining a domain
Currently the only type supported is 'xen' Currently the only type supported is 'xen'
The description must start with the identification informations and then The description must start with the identification informations and then
os, resources, features, devices and termination informations can be os or bootloader, resources, features, devices and termination informations
given in any order. can be given in any order.
--> -->
<define name='domain'> <define name='domain'>
<element name="domain"> <element name="domain">
@ -20,7 +20,20 @@
</attribute> </attribute>
<ref name='ids'/> <ref name='ids'/>
<interleave> <interleave>
<ref name='os'/> <choice>
<group>
<ref name='os'/>
<optional>
<ref name='bootloader'/>
</optional>
</group>
<group>
<ref name='bootloader'/>
<optional>
<ref name='os'/>
</optional>
</group>
</choice>
<ref name='resources'/> <ref name='resources'/>
<ref name='features'/> <ref name='features'/>
<ref name='termination'/> <ref name='termination'/>
@ -56,6 +69,7 @@
<!-- <!--
Resources usage defines the amount of memory (maximum and possibly Resources usage defines the amount of memory (maximum and possibly
current usage) and number of virtual CPUs used by that domain. current usage) and number of virtual CPUs used by that domain.
We can't check here the rule that currentMemory <= memory
--> -->
<define name='resources'> <define name='resources'>
@ -63,12 +77,29 @@
<element name='memory'> <element name='memory'>
<ref name='memoryKB'/> <ref name='memoryKB'/>
</element> </element>
<element name='vcpu'> <optional>
<ref name='countCPU'/> <element name='currentMemory'>
</element> <ref name='memoryKB'/>
</element>
</optional>
<optional>
<element name='vcpu'>
<ref name='countCPU'/>
</element>
</optional>
</interleave> </interleave>
</define> </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'>
<element name='bootloader'>
<ref name='absFilePath'/>
</element>
</define>
<!-- <!--
The Operating system can be: The Operating system can be:
- a linux paravirtualized OS - a linux paravirtualized OS
@ -100,9 +131,11 @@
<ref name='absFilePath'/> <ref name='absFilePath'/>
</element> </element>
</optional> </optional>
<element name='root'> <optional>
<ref name='devicePath'/> <element name='root'>
</element> <ref name='devicePath'/>
</element>
</optional>
<optional> <optional>
<element name='cmdline'> <element name='cmdline'>
<text/> <text/>
@ -145,20 +178,20 @@
--> -->
<define name='disk'> <define name='disk'>
<element name='disk'> <element name='disk'>
<optional>
<attribute name='device'>
<choice>
<value>floppy</value>
<value>disk</value>
<value>cdrom</value>
</choice>
</attribute>
</optional>
<choice> <choice>
<group> <group>
<attribute name='type'> <attribute name='type'>
<value>file</value> <value>file</value>
</attribute> </attribute>
<optional>
<attribute name='device'>
<choice>
<value>floppy</value>
<value>disk</value>
<value>cdrom</value>
</choice>
</attribute>
</optional>
<interleave> <interleave>
<element name='source'> <element name='source'>
<attribute name='file'> <attribute name='file'>
@ -166,8 +199,13 @@
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
<optional>
<ref name='driver'/>
</optional>
<ref name='target'/> <ref name='target'/>
<ref name='readonly'/> <optional>
<ref name='readonly'/>
</optional>
</interleave> </interleave>
</group> </group>
<group> <group>
@ -181,8 +219,13 @@
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
<optional>
<ref name='driver'/>
</optional>
<ref name='target'/> <ref name='target'/>
<ref name='readonly'/> <optional>
<ref name='readonly'/>
</optional>
</interleave> </interleave>
</group> </group>
</choice> </choice>
@ -198,29 +241,86 @@
</define> </define>
<define name='readonly'> <define name='readonly'>
<optional> <element name='readonly'>
<element name='readonly'> <empty/>
<empty/> </element>
</element>
</optional>
</define> </define>
<!-- <!--
An interface description Disk may use a special driver for access. Currently this is
only defined for Xen for tap/aio and file, but will certainly be
extended in the future, and libvirt doesn't look for specific values.
-->
<define name='driver'>
<element name='driver'>
<attribute name='name'>
<ref name='genericName'/>
</attribute>
<optional>
<attribute name='type'>
<ref name='genericName'/>
</attribute>
</optional>
<empty/>
</element>
</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.
--> -->
<define name='interface'> <define name='interface'>
<element name='interface'> <element name='interface'>
<attribute name='type'> <choice>
<value>bridge</value> <group>
</attribute> <attribute name='type'>
<value>bridge</value>
</attribute>
<interleave>
<element name='source'>
<attribute name='bridge'>
<ref name='deviceName'/>
</attribute>
<empty/>
</element>
<ref name='interface-options'/>
</interleave>
</group>
<group>
<attribute name='type'>
<value>ethernet</value>
</attribute>
<interleave>
<element name='source'>
<attribute name='dev'>
<ref name='deviceName'/>
</attribute>
<empty/>
</element>
<ref name='interface-options'/>
</interleave>
</group>
</choice>
</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
-->
<define name='interface-options'>
<interleave> <interleave>
<element name='source'> <optional>
<attribute name='bridge'> <element name='target'>
<ref name='deviceName'/> <attribute name='dev'>
</attribute> <ref name='deviceName'/>
<empty/> </attribute>
</element> <empty/>
</element>
</optional>
<optional> <optional>
<element name='mac'> <element name='mac'>
<attribute name='address'> <attribute name='address'>
@ -246,7 +346,6 @@
</element> </element>
</optional> </optional>
</interleave> </interleave>
</element>
</define> </define>
<!-- <!--
@ -259,7 +358,9 @@
</define> </define>
<!-- <!--
A graphic description A graphic description, currently in Xen only 2 types are supported:
- sdl without arguments
- vnc with a required port and optional listen IP address and password
--> -->
<define name='graphic'> <define name='graphic'>
<element name='graphics'> <element name='graphics'>
@ -274,6 +375,16 @@
<attribute name='port'> <attribute name='port'>
<ref name='PortNumber'/> <ref name='PortNumber'/>
</attribute> </attribute>
<optional>
<attribute name='listen'>
<ref name='addrIP'/>
</attribute>
</optional>
<optional>
<attribute name='passwd'>
<text/>
</attribute>
</optional>
</group> </group>
</choice> </choice>
</element> </element>
@ -409,9 +520,8 @@
</data> </data>
</define> </define>
<define name='PortNumber'> <define name='PortNumber'>
<data type='unsignedShort'> <data type='short'>
<param name="pattern">[0-9]+</param> <param name="minInclusive">-1</param>
<param name="minInclusive">1</param>
</data> </data>
</define> </define>
<define name='memoryKB'> <define name='memoryKB'>
@ -425,6 +535,11 @@
<param name="pattern">[a-zA-Z0-9_\+\-]+</param> <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
</data> </data>
</define> </define>
<define name='genericName'>
<data type='string'>
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
</data>
</define>
<define name='UUID'> <define name='UUID'>
<!-- TODO: be more flexible on UUID --> <!-- TODO: be more flexible on UUID -->
<data type='string'> <data type='string'>
@ -448,7 +563,7 @@
</define> </define>
<define name='deviceName'> <define name='deviceName'>
<data type='string'> <data type='string'>
<param name="pattern">[a-zA-Z0-9_\-]+</param> <param name="pattern">[a-zA-Z0-9_\-\:\.\/]+</param>
</data> </data>
</define> </define>
<define name='addrMAC'> <define name='addrMAC'>