libvirt/docs/schemas/capability.rng
Srivatsa S. Bhat e352b16400 Export KVM Host Power Management capabilities
This patch exports KVM Host Power Management capabilities as XML so that
higher-level systems management software can make use of these features
available in the host.

The script "pm-is-supported" (from pm-utils package) is run to discover if
Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
If either of them are supported, then a new tag "<power_management>" is
introduced in the XML under the <host> tag.

However in case the query to check for power management features succeeded,
but the host does not support any such feature, then the XML will contain
an empty <power_management/> tag. In the event that the PM query itself
failed, the XML will not contain any "power_management" tag.

To use this, new APIs could be implemented in libvirt to exploit power
management features such as S3/S4.
2011-11-22 11:31:22 +08:00

401 lines
8.7 KiB
Plaintext

<!-- 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">
<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>
<element name='cpu'>
<element name='arch'>
<ref name='archnames'/>
</element>
<optional>
<ref name='cpufeatures'/>
</optional>
<optional>
<ref name='cpuspec'/>
</optional>
</element>
<optional>
<ref name='power_management'/>
</optional>
<optional>
<ref name='migration'/>
</optional>
<optional>
<ref name='topology'/>
</optional>
<optional>
<ref name='secmodel'/>
</optional>
</element>
</define>
<define name='secmodel'>
<element name='secmodel'>
<element name='model'>
<text/>
</element>
<element name='doi'>
<text/>
</element>
</element>
</define>
<define name='cpufeatures'>
<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>
</define>
<define name='cpuspec'>
<element name='model'>
<text/>
</element>
<optional>
<element name='vendor'>
<text/>
</element>
</optional>
<element name='topology'>
<attribute name='sockets'>
<ref name='positiveInteger'/>
</attribute>
<attribute name='cores'>
<ref name='positiveInteger'/>
</attribute>
<attribute name='threads'>
<ref name='positiveInteger'/>
</attribute>
</element>
<zeroOrMore>
<element name='feature'>
<attribute name='name'>
<ref name='featureName'/>
</attribute>
<empty/>
</element>
</zeroOrMore>
</define>
<define name='power_management'>
<element name='power_management'>
<interleave>
<optional>
<element name='S3'>
<empty/>
</element>
</optional>
<optional>
<element name='S4'>
<empty/>
</element>
</optional>
</interleave>
</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>esx</value>
<value>tcp</value>
<value>xenmigr</value>
</choice>
</element>
</oneOrMore>
</element>
</optional>
</element>
</define>
<define name='topology'>
<element name='topology'>
<element name='cells'>
<attribute name='num'>
<ref name='uint'/>
</attribute>
<oneOrMore>
<ref name='cell'/>
</oneOrMore>
</element>
</element>
</define>
<define name='cell'>
<element name='cell'>
<attribute name='id'>
<ref name='uint'/>
</attribute>
<optional>
<element name='cpus'>
<attribute name='num'>
<ref name='uint'/>
</attribute>
<oneOrMore>
<ref name='cpu'/>
</oneOrMore>
</element>
</optional>
</element>
</define>
<define name='cpu'>
<element name='cpu'>
<attribute name='id'>
<ref name='uint'/>
</attribute>
</element>
</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' - legacy -->
<value>hvm</value> <!-- unmodified OS -->
<value>exe</value> <!-- For container based virt -->
<value>uml</value> <!-- user mode linux -->
</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='path'/>
</element>
</define>
<define name='loader'>
<element name='loader'>
<ref name='path'/>
</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>
<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>
<value>lxc</value>
<value>openvz</value>
<value>test</value>
</choice>
</attribute>
<optional>
<ref name='emulator'/>
</optional>
<zeroOrMore>
<ref name='machine'/>
</zeroOrMore>
</element>
</define>
<define name='features'>
<element name='features'>
<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>
</element>
</define>
<define name='featuretoggle'>
<attribute name='toggle'>
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
<attribute name='default'>
<choice>
<value>on</value>
<value>off</value>
</choice>
</attribute>
</define>
<define name='archnames'>
<choice>
<value>arm</value>
<value>i686</value>
<value>ia64</value>
<value>microblaze</value>
<value>microblazeel</value>
<value>mips</value>
<value>mipsel</value>
<value>ppc64</value>
<value>ppc</value>
<value>s390</value>
<value>sparc</value>
<value>x86_64</value>
</choice>
</define>
<define name='positiveInteger'>
<data type='positiveInteger'>
<param name="pattern">[0-9]+</param>
</data>
</define>
<define name='uint'>
<data type='unsignedInt'>
<param name="pattern">[0-9]+</param>
</data>
</define>
<define name='path'>
<data type='string'>
<param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
</data>
</define>
<define name='featureName'>
<data type='string'>
<param name='pattern'>[a-zA-Z0-9\-_]+</param>
</data>
</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>
</grammar>