Update RNG schema for domains

This commit is contained in:
Daniel P. Berrange 2008-07-08 12:05:13 +00:00
parent 95675d4d76
commit 93118c7efe
2 changed files with 429 additions and 277 deletions

View File

@ -8,88 +8,130 @@
<!-- <!--
We handle only document defining a domain We handle only document defining a domain
Currently the virtualization types supported are:
- xen, either paravirualized with a linux os or fully virtualized (hvm)
- kvm, requiring a path to the emulator in devices
- qemu, where the arch and machine must be provided in the os block
--> -->
<define name='domain'> <define name='domain'>
<element name="domain"> <element name="domain">
<choice> <ref name='hvs'/>
<ref name='xen-domain'/>
<ref name='kvm-domain'/>
<ref name='qemu-domain'/>
</choice>
</element>
</define>
<!--
Description of a Xen domain:
The description must start with the identification information and then
os or bootloader, resources, features, devices and termination information
can be given in any order.
-->
<define name='xen-domain'>
<group>
<attribute name='type'>
<value>xen</value>
</attribute>
<ref name='ids'/> <ref name='ids'/>
<interleave> <interleave>
<choice>
<group>
<ref name='os'/> <ref name='os'/>
<optional> <ref name='clock'/>
<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'/>
<optional>
<ref name='devices'/> <ref name='devices'/>
</optional>
</interleave> </interleave>
</group> </element>
</define> </define>
<!-- <define name='hvs'>
Description of a QEmu domain:
The description must start with the identification information and then
os, resources, devices can be given in any order.
The specific part are the combinations of architectures and machines
being emulated.
-->
<define name='qemu-domain'>
<group>
<attribute name='type'> <attribute name='type'>
<value>qemu</value>
</attribute>
<ref name='ids'/>
<interleave>
<element name='os'>
<element name='type'>
<choice> <choice>
<ref name='qemu-x86'/> <value>xen</value>
<ref name='qemu-mips'/> <value>kvm</value>
<ref name='qemu-sparc'/> <value>kqemu</value>
<ref name='qemu-ppc'/> <value>qemu</value>
<value>lxc</value>
<value>openvz</value>
<value>test</value>
</choice> </choice>
</attribute>
</define>
<define name='os'>
<choice>
<ref name='osxen'/>
<ref name='oshvm'/>
</choice>
</define>
<define name='osxen'>
<choice>
<group>
<optional>
<ref name='bootloader'/>
</optional>
<element name='os'>
<ref name='ostypexen'/>
<ref name='osbootkernel'/>
</element>
</group>
<group>
<ref name='bootloader'/>
<optional>
<element name='os'>
<ref name='ostypexen'/>
<optional>
<ref name='osbootkernel'/>
</optional>
</element>
</optional>
</group>
</choice>
</define>
<define name='oshvm'>
<element name='os'>
<ref name='ostypehvm'/>
<interleave>
<optional>
<element name='loader'>
<ref name='absFilePath'/>
</element>
</optional>
<choice>
<ref name='osbootkernel'/>
<ref name='osbootdev'/>
</choice>
</interleave>
</element>
</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>xenner</value>
</choice>
</attribute>
</optional>
<choice>
<value>xen</value>
<value>linux</value>
</choice>
</element>
</define>
<define name='ostypehvm'>
<element name='type'>
<optional>
<choice>
<ref name='hvmx86'/>
<ref name='hvmmips'/>
<ref name='hvmsparc'/>
<ref name='hvmppc'/>
</choice>
</optional>
<value>hvm</value> <value>hvm</value>
</element> </element>
</element>
<ref name='resources'/>
<ref name='devices'/>
</interleave>
</group>
</define> </define>
<define name='qemu-x86'> <define name='hvmx86'>
<group> <group>
<attribute name='arch'> <attribute name='arch'>
<choice> <choice>
@ -106,7 +148,7 @@
</group> </group>
</define> </define>
<define name='qemu-mips'> <define name='hvmmips'>
<group> <group>
<attribute name='arch'> <attribute name='arch'>
<value>mips</value> <value>mips</value>
@ -117,7 +159,7 @@
</group> </group>
</define> </define>
<define name='qemu-sparc'> <define name='hvmsparc'>
<group> <group>
<attribute name='arch'> <attribute name='arch'>
<value>sparc</value> <value>sparc</value>
@ -128,7 +170,7 @@
</group> </group>
</define> </define>
<define name='qemu-ppc'> <define name='hvmppc'>
<group> <group>
<attribute name='arch'> <attribute name='arch'>
<value>ppc</value> <value>ppc</value>
@ -143,28 +185,6 @@
</group> </group>
</define> </define>
<!--
Description of a KVM domain:
The description must start with the identification information and then
os, resources, devices can be given in any order.
-->
<define name='kvm-domain'>
<group>
<attribute name='type'>
<value>kvm</value>
</attribute>
<ref name='ids'/>
<interleave>
<element name='os'>
<element name='type'>
<value>hvm</value>
</element>
</element>
<ref name='resources'/>
<ref name='devices-with-emulator'/>
</interleave>
</group>
</define>
<!-- <!--
The Identifiers can be: The Identifiers can be:
@ -208,44 +228,51 @@
</optional> </optional>
<optional> <optional>
<element name='vcpu'> <element name='vcpu'>
<optional>
<attribute name='cpuset' />
</optional>
<ref name='countCPU'/> <ref name='countCPU'/>
</element> </element>
</optional> </optional>
</interleave> </interleave>
</define> </define>
<define name='clock'>
<optional>
<element name='clock'>
<attribute name='offset'>
<choice>
<value>localtime</value>
<value>utc</value>
</choice>
</attribute>
<empty/>
</element>
</optional>
</define>
<!-- <!--
A bootloader may be used to extract the OS information instead of A bootloader may be used to extract the OS information instead of
defining the OS parameter in the instance. It points just to the 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. binary or script used to extract the data from the first disk device.
--> -->
<define name='bootloader'> <define name='bootloader'>
<interleave>
<element name='bootloader'> <element name='bootloader'>
<ref name='absFilePath'/>
</element>
</define>
<!--
The Operating system can be:
- a linux paravirtualized OS
- a fully virtualized machine where the OS is unknown
-->
<define name='os'>
<element name='os'>
<choice> <choice>
<ref name='linux'/> <ref name='absFilePath'/>
<ref name='hvm'/> <empty/>
</choice> </choice>
</element> </element>
<optional>
<element name='bootloader_args'>
<text/>
</element>
</optional>
</interleave>
</define> </define>
<!-- <define name='osbootkernel'>
A paravirtualized linux domain, this requires at least a kernel path
and the root device, the initrd and command line arguments are optional
-->
<define name='linux'>
<element name='type'>
<value>linux</value>
</element>
<interleave> <interleave>
<element name='kernel'> <element name='kernel'>
<ref name='absFilePath'/> <ref name='absFilePath'/>
@ -268,31 +295,36 @@
</interleave> </interleave>
</define> </define>
<!-- <define name='osbootdev'>
A fully virtualized domain, this requires the path to the loader and
an optional boot device (hd, fd or cdrom).
-->
<define name='hvm'>
<element name='type'>
<value>hvm</value>
</element>
<interleave>
<element name='loader'>
<ref name='absFilePath'/>
</element>
<optional>
<element name='boot'> <element name='boot'>
<attribute name='dev'> <attribute name='dev'>
<choice> <choice>
<value>hd</value> <value>hd</value>
<value>fd</value> <value>fd</value>
<value>cdrom</value> <value>cdrom</value>
<value>network</value>
</choice> </choice>
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
</define>
<define name='diskspec'>
<optional>
<ref name='driver'/>
</optional>
<ref name='target'/>
<optional>
<element name='readonly'>
<empty/>
</element>
</optional>
<optional>
<element name='shareable'>
<empty/>
</element>
</optional> </optional>
</interleave>
</define> </define>
<!-- <!--
@ -317,19 +349,15 @@
<value>file</value> <value>file</value>
</attribute> </attribute>
<interleave> <interleave>
<optional>
<element name='source'> <element name='source'>
<attribute name='file'> <attribute name='file'>
<ref name='absFilePath'/> <ref name='absFilePath'/>
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
<optional>
<ref name='driver'/>
</optional>
<ref name='target'/>
<optional>
<ref name='readonly'/>
</optional> </optional>
<ref name='diskspec'/>
</interleave> </interleave>
</group> </group>
<group> <group>
@ -337,21 +365,18 @@
<value>block</value> <value>block</value>
</attribute> </attribute>
<interleave> <interleave>
<optional>
<element name='source'> <element name='source'>
<attribute name='dev'> <attribute name='dev'>
<ref name='deviceName'/> <ref name='deviceName'/>
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
<optional>
<ref name='driver'/>
</optional>
<ref name='target'/>
<optional>
<ref name='readonly'/>
</optional> </optional>
<ref name='diskspec'/>
</interleave> </interleave>
</group> </group>
<ref name='diskspec'/>
</choice> </choice>
</element> </element>
</define> </define>
@ -361,12 +386,16 @@
<attribute name='dev'> <attribute name='dev'>
<ref name='deviceName'/> <ref name='deviceName'/>
</attribute> </attribute>
</element> <optional>
</define> <attribute name='bus'>
<choice>
<define name='readonly'> <value>ide</value>
<element name='readonly'> <value>virtio</value>
<empty/> <value>fdc</value>
<value>xen</value>
</choice>
</attribute>
</optional>
</element> </element>
</define> </define>
@ -392,7 +421,7 @@
An interface description can either be of type bridge in which case 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 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 source and a device target instead. They both share a set of interface
options. options. FIXME
--> -->
<define name='interface'> <define name='interface'>
<element name='interface'> <element name='interface'>
@ -402,12 +431,14 @@
<value>bridge</value> <value>bridge</value>
</attribute> </attribute>
<interleave> <interleave>
<optional>
<element name='source'> <element name='source'>
<attribute name='bridge'> <attribute name='bridge'>
<ref name='deviceName'/> <ref name='deviceName'/>
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
</optional>
<ref name='interface-options'/> <ref name='interface-options'/>
</interleave> </interleave>
</group> </group>
@ -416,12 +447,28 @@
<value>ethernet</value> <value>ethernet</value>
</attribute> </attribute>
<interleave> <interleave>
<optional>
<element name='source'> <element name='source'>
<attribute name='dev'> <attribute name='dev'>
<ref name='deviceName'/> <ref name='deviceName'/>
</attribute> </attribute>
<empty/> <empty/>
</element> </element>
</optional>
<ref name='interface-options'/>
</interleave>
</group>
<group>
<attribute name='type'>
<value>network</value>
</attribute>
<interleave>
<element name='source'>
<attribute name='network'>
<ref name='deviceName'/>
</attribute>
<empty/>
</element>
<ref name='interface-options'/> <ref name='interface-options'/>
</interleave> </interleave>
</group> </group>
@ -478,11 +525,17 @@
<empty/> <empty/>
</element> </element>
</optional> </optional>
<optional>
<element name='model'>
<attribute name='type' />
<empty/>
</element>
</optional>
</interleave> </interleave>
</define> </define>
<!-- <!--
An emulator descritpion is just a path to the binary used for the task An emulator description is just a path to the binary used for the task
--> -->
<define name='emulator'> <define name='emulator'>
<element name='emulator'> <element name='emulator'>
@ -493,7 +546,8 @@
<!-- <!--
A graphic description, currently in Xen only 2 types are supported: A graphic description, currently in Xen only 2 types are supported:
- sdl without arguments - sdl without arguments
- vnc with a required port and optional listen IP address and password - vnc with a required port and optional listen IP address, password
and keymap
--> -->
<define name='graphic'> <define name='graphic'>
<element name='graphics'> <element name='graphics'>
@ -505,9 +559,19 @@
<attribute name='type'> <attribute name='type'>
<value>vnc</value> <value>vnc</value>
</attribute> </attribute>
<optional>
<attribute name='port'> <attribute name='port'>
<ref name='PortNumber'/> <ref name='PortNumber'/>
</attribute> </attribute>
</optional>
<optional>
<attribute name='autoport'>
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
</optional>
<optional> <optional>
<attribute name='listen'> <attribute name='listen'>
<ref name='addrIP'/> <ref name='addrIP'/>
@ -518,6 +582,11 @@
<text/> <text/>
</attribute> </attribute>
</optional> </optional>
<optional>
<attribute name='keymap'>
<text/>
</attribute>
</optional>
</group> </group>
</choice> </choice>
</element> </element>
@ -564,25 +633,131 @@
</choice> </choice>
</define> </define>
<!--
Specific setup for a qemu emulated character device. Note: this
definition doesn't fully specify the constraints on this node.
-->
<define name='qemucdev'>
<attribute name='type'>
<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>
</choice>
</attribute>
<interleave>
<optional>
<oneOrMore>
<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='wiremode' />
</optional>
</element>
</oneOrMore>
</optional>
<optional>
<element name='protocol'>
<optional>
<attribute name='type' />
</optional>
</element>
</optional>
<optional>
<element name='target'>
<optional>
<attribute name='port' />
</optional>
</element>
</optional>
</interleave>
</define>
<!-- <!--
The description for a console The description for a console
just a tty device just a tty device
--> -->
<define name='console'> <define name='console'>
<element name='console'> <element name='console'>
<choice>
<group>
<optional>
<attribute name='tty'> <attribute name='tty'>
<ref name='devicePath'/> <ref name='devicePath'/>
</attribute> </attribute>
</optional>
<empty/> <empty/>
</group>
<ref name='qemucdev' />
</choice>
</element>
</define>
<define name='sound'>
<element name='sound'>
<attribute name='model'>
<choice>
<value>sb16</value>
<value>es1370</value>
<value>pcspk</value>
</choice>
</attribute>
</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='input'>
<element name='input'>
<attribute name='type'>
<choice>
<value>tablet</value>
<value>mouse</value>
</choice>
</attribute>
<optional>
<attribute name='bus'>
<choice>
<value>ps2</value>
<value>usb</value>
<value>xen</value>
</choice>
</attribute>
</optional>
</element> </element>
</define> </define>
<!-- <!--
The devices bloc allows: Devices attached to a domain.
- an optional emulator path, restricted to hvm configs but hard to check
- an optional graphic description , restricted to hvm configs too
- zero or more disk devices
- zero or more interface devices
--> -->
<define name='devices'> <define name='devices'>
<element name='devices'> <element name='devices'>
@ -590,41 +765,18 @@
<optional> <optional>
<ref name='emulator'/> <ref name='emulator'/>
</optional> </optional>
<optional> <zeroOrMore>
<choice>
<ref name='graphic'/> <ref name='graphic'/>
</optional>
<zeroOrMore>
<ref name='disk'/> <ref name='disk'/>
</zeroOrMore>
<zeroOrMore>
<ref name='interface'/> <ref name='interface'/>
</zeroOrMore>
<optional>
<ref name='console'/> <ref name='console'/>
</optional> <ref name='sound'/>
</interleave> <ref name='parallel'/>
</element> <ref name='serial'/>
</define> <ref name='input'/>
</choice>
<!--
Sometimes the emulator is mandatory, e.g. with KVM
-->
<define name='devices-with-emulator'>
<element name='devices'>
<interleave>
<ref name='emulator'/>
<optional>
<ref name='graphic'/>
</optional>
<zeroOrMore>
<ref name='disk'/>
</zeroOrMore> </zeroOrMore>
<zeroOrMore>
<ref name='interface'/>
</zeroOrMore>
<optional>
<ref name='console'/>
</optional>
</interleave> </interleave>
</element> </element>
</define> </define>
@ -688,7 +840,7 @@
</define> </define>
<define name='domainName'> <define name='domainName'>
<data type='string'> <data type='string'>
<param name="pattern">[a-zA-Z0-9_\+\-]+</param> <param name="pattern">[a-zA-Z0-9_\+\-&amp;]+</param>
</data> </data>
</define> </define>
<define name='genericName'> <define name='genericName'>
@ -708,12 +860,12 @@
</define> </define>
<define name='filePath'> <define name='filePath'>
<data type='string'> <data type='string'>
<param name="pattern">[a-zA-Z0-9_\+\-%./]+</param> <param name="pattern">[a-zA-Z0-9_\+\-%./&amp;]+</param>
</data> </data>
</define> </define>
<define name='absFilePath'> <define name='absFilePath'>
<data type='string'> <data type='string'>
<param name="pattern">/[a-zA-Z0-9_\+\-%./]+</param> <param name="pattern">/[a-zA-Z0-9_\+\-%./&amp;]+</param>
</data> </data>
</define> </define>
<define name='devicePath'> <define name='devicePath'>

View File

@ -4,9 +4,9 @@
<memory>219200</memory> <memory>219200</memory>
<currentMemory>219200</currentMemory> <currentMemory>219200</currentMemory>
<vcpu>1</vcpu> <vcpu>1</vcpu>
<bootloader>/foo</bootloader>
<os> <os>
<type>xen</type> <type>xen</type>
<boot dev='hd'/>
</os> </os>
<clock offset='utc'/> <clock offset='utc'/>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>