libvirt/docs/schemas/capability.rng
Michal Privoznik 02129b7c0e virCaps: expose pages info
There are two places where you'll find info on page sizes. The first
one is under <cpu/> element, where all supported pages sizes are
listed. Then the second one is under each <cell/> element which refers
to concrete NUMA node. At this place, the size of page's pool is
reported. So the capabilities XML looks something like this:

<capabilities>

  <host>
    <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Westmere</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='1' threads='1'/>
      ...
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
      <pages unit='KiB' size='1048576'/>
    </cpu>
    ...
    <topology>
      <cells num='4'>
        <cell id='0'>
          <memory unit='KiB'>4054408</memory>
          <pages unit='KiB' size='4'>1013602</pages>
          <pages unit='KiB' size='2048'>3</pages>
          <pages unit='KiB' size='1048576'>1</pages>
          <distances/>
          <cpus num='1'>
            <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
          </cpus>
        </cell>
        <cell id='1'>
          <memory unit='KiB'>4071072</memory>
          <pages unit='KiB' size='4'>1017768</pages>
          <pages unit='KiB' size='2048'>3</pages>
          <pages unit='KiB' size='1048576'>1</pages>
          <distances/>
          <cpus num='1'>
            <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
        ...
      </cells>
    </topology>
    ...
  </host>

  <guest/>

</capabilities>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-06-19 15:10:49 +02:00

441 lines
9.8 KiB
XML

<?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'/>
<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>
<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='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>
<zeroOrMore>
<ref name='pagesElem'/>
</zeroOrMore>
</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='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='unsignedInt'/>
</attribute>
<oneOrMore>
<ref name='cell'/>
</oneOrMore>
</element>
</element>
</define>
<define name='cell'>
<element name='cell'>
<attribute name='id'>
<ref name='unsignedInt'/>
</attribute>
<optional>
<ref name='memory'/>
</optional>
<zeroOrMore>
<ref name='pagesElem'/>
</zeroOrMore>
<optional>
<element name='distances'>
<zeroOrMore>
<element name='sibling'>
<attribute name='id'>
<ref name='unsignedInt'/>
</attribute>
<attribute name='value'>
<ref name='unsignedInt'/>
</attribute>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<element name='cpus'>
<attribute name='num'>
<ref name='unsignedInt'/>
</attribute>
<oneOrMore>
<ref name='cpu'/>
</oneOrMore>
</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='core_id'>
<ref name='unsignedInt'/>
</attribute>
<attribute name='siblings'>
<ref name='cpuset'/>
</attribute>
</optional>
</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='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>
<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'>
<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>
</interleave>
</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='featureName'>
<data type='string'>
<param name='pattern'>[a-zA-Z0-9\-_]+</param>
</data>
</define>
<define name='pagesElem'>
<element name='pages'>
<optional>
<attribute name='unit'>
<ref name='unit'/>
</attribute>
</optional>
<attribute name='size'>
<ref name='unsignedInt'/>
</attribute>
<ref name='unsignedInt'/>
</element>
</define>
</grammar>