mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
74119a03f1
Add support for describing NUMA distances in a domain's <numa> <cell> XML description. Below is an example of a 4 node setup: <cpu> <numa> <cell id='0' cpus='0-3' memory='2097152' unit='KiB'> <distances> <sibling id='0' value='10'/> <sibling id='1' value='21'/> <sibling id='2' value='31'/> <sibling id='3' value='21'/> </distances> </cell> <cell id='1' cpus='4-7' memory='2097152' unit='KiB'> <distances> <sibling id='0' value='21'/> <sibling id='1' value='10'/> <sibling id='2' value='21'/> <sibling id='3' value='31'/> </distances> </cell> <cell id='2' cpus='8-11' memory='2097152' unit='KiB'> <distances> <sibling id='0' value='31'/> <sibling id='1' value='21'/> <sibling id='2' value='10'/> <sibling id='3' value='21'/> </distances> <cell id='3' cpus='12-15' memory='2097152' unit='KiB'> <distances> <sibling id='0' value='21'/> <sibling id='1' value='31'/> <sibling id='2' value='21'/> <sibling id='3' value='10'/> </distances> </cell> </numa> </cpu> A <cell> defines a NUMA node. <distances> describes the NUMA distance from the <cell> to the other NUMA nodes (the <sibling>s). For example, in above XML description, the distance between NUMA node0 <cell id='0' ...> and NUMA node2 <sibling id='2' ...> is 31. Valid distance values are '10 <= value <= 255'. A distance value of 10 represents the distance to the node itself. A distance value of 20 represents the default value for remote nodes but other values are possible depending on the physical topology of the system. When distances are not fully described, any missing sibling distance values will default to 10 for local nodes and 20 for remote nodes. If distance is given for A -> B, then we default B -> A to the same value instead of 20. Signed-off-by: Wim ten Have <wim.ten.have@oracle.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
185 lines
4.2 KiB
XML
185 lines
4.2 KiB
XML
<?xml version="1.0"?>
|
|
<!-- CPU-related definitions used in multiple grammars -->
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
|
|
<define name="cpuMode">
|
|
<attribute name="mode">
|
|
<choice>
|
|
<value>custom</value>
|
|
<value>host-model</value>
|
|
<value>host-passthrough</value>
|
|
</choice>
|
|
</attribute>
|
|
</define>
|
|
|
|
<define name="cpuMatch">
|
|
<attribute name="match">
|
|
<choice>
|
|
<value>minimum</value>
|
|
<value>exact</value>
|
|
<value>strict</value>
|
|
</choice>
|
|
</attribute>
|
|
</define>
|
|
|
|
<define name="cpuCheck">
|
|
<attribute name="check">
|
|
<choice>
|
|
<value>none</value>
|
|
<value>partial</value>
|
|
<value>full</value>
|
|
</choice>
|
|
</attribute>
|
|
</define>
|
|
|
|
<define name="cpuModel">
|
|
<element name="model">
|
|
<optional>
|
|
<attribute name="fallback">
|
|
<choice>
|
|
<value>allow</value>
|
|
<value>forbid</value>
|
|
</choice>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="vendor_id">
|
|
<data type="string">
|
|
<param name='pattern'>[^,]{12}</param>
|
|
</data>
|
|
</attribute>
|
|
</optional>
|
|
<choice>
|
|
<text/>
|
|
<empty/>
|
|
</choice>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="cpuVendor">
|
|
<element name="vendor">
|
|
<text/>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="cpuFeature">
|
|
<element name="feature">
|
|
<attribute name="policy">
|
|
<choice>
|
|
<value>force</value>
|
|
<value>require</value>
|
|
<value>optional</value>
|
|
<value>disable</value>
|
|
<value>forbid</value>
|
|
</choice>
|
|
</attribute>
|
|
<attribute name="name">
|
|
<ref name="featureName"/>
|
|
</attribute>
|
|
<empty/>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="cpuTopology">
|
|
<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>
|
|
</define>
|
|
|
|
<define name="cpuNuma">
|
|
<element name="numa">
|
|
<oneOrMore>
|
|
<ref name="numaCell"/>
|
|
</oneOrMore>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="numaCell">
|
|
<element name="cell">
|
|
<optional>
|
|
<attribute name="id">
|
|
<ref name="unsignedInt"/>
|
|
</attribute>
|
|
</optional>
|
|
<attribute name="cpus">
|
|
<ref name="cpuset"/>
|
|
</attribute>
|
|
<attribute name="memory">
|
|
<ref name="memoryKB"/>
|
|
</attribute>
|
|
<optional>
|
|
<attribute name="unit">
|
|
<ref name="unit"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="memAccess">
|
|
<choice>
|
|
<value>shared</value>
|
|
<value>private</value>
|
|
</choice>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<element name="distances">
|
|
<oneOrMore>
|
|
<ref name="numaDistance"/>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="numaDistance">
|
|
<element name="sibling">
|
|
<attribute name="id">
|
|
<ref name="unsignedInt"/>
|
|
</attribute>
|
|
<attribute name="value">
|
|
<ref name="numaDistanceValue"/>
|
|
</attribute>
|
|
</element>
|
|
</define>
|
|
|
|
<!-- Memory as an attribute is in KiB, no way to express a unit -->
|
|
<define name="memoryKB">
|
|
<data type="unsignedLong"/>
|
|
</define>
|
|
<define name="featureName">
|
|
<data type="string">
|
|
<param name='pattern'>[a-zA-Z0-9\-_\.]+</param>
|
|
</data>
|
|
</define>
|
|
|
|
<define name="cpuCache">
|
|
<element name="cache">
|
|
<optional>
|
|
<attribute name="level">
|
|
<choice>
|
|
<value>1</value>
|
|
<value>2</value>
|
|
<value>3</value>
|
|
</choice>
|
|
</attribute>
|
|
</optional>
|
|
<attribute name="mode">
|
|
<choice>
|
|
<value>emulate</value>
|
|
<value>passthrough</value>
|
|
<value>disable</value>
|
|
</choice>
|
|
</attribute>
|
|
</element>
|
|
</define>
|
|
|
|
</grammar>
|