mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
domcaps: Add support for listing supported CPU models
The patch adds <cpu> element to domain capabilities XML:
<cpu>
<mode name='host-passthrough' supported='yes'/>
<mode name='host-model' supported='yes'/>
<mode name='custom' supported='yes'>
<model>Broadwell</model>
<model>Broadwell-noTSX</model>
...
</mode>
</cpu>
Applications can use it to inspect what CPU configuration modes are
supported for a specific combination of domain type, emulator binary,
guest architecture and machine type.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
@@ -142,6 +142,50 @@
|
||||
<loader/> element.</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsCPU">CPU configuration</a></h3>
|
||||
|
||||
<p>
|
||||
The <code>cpu</code> element exposes options usable for configuring
|
||||
<a href="formatdomain.html#elementsCPU">guest CPUs</a>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<domainCapabilities>
|
||||
...
|
||||
<cpu>
|
||||
<mode name='host-passthrough' supported='yes'/>
|
||||
<mode name='host-model' supported='yes'/>
|
||||
<mode name='custom' supported='yes'>
|
||||
<model>Broadwell</model>
|
||||
<model>Broadwell-noTSX</model>
|
||||
<model>Haswell</model>
|
||||
...
|
||||
</mode>
|
||||
</cpu>
|
||||
...
|
||||
<domainCapabilities>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Each CPU mode understood by libvirt is described with a
|
||||
<code>mode</code> element which tells whether the particular mode
|
||||
is supported and provides (when applicable) more details about it:
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt><code>host-passthrough</code></dt>
|
||||
<dd>No mode specific details are provided.</dd>
|
||||
|
||||
<dt><code>host-model</code></dt>
|
||||
<dd>No mode specific details are provided yet.</dd>
|
||||
|
||||
<dt><code>custom</code></dt>
|
||||
<dd>
|
||||
The <code>mode</code> element contains a list of supported CPU
|
||||
models, each described by a dedicated <code>model</code> element.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsDevices">Devices</a></h3>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<optional>
|
||||
<ref name='os'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='cpu'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='devices'/>
|
||||
</optional>
|
||||
@@ -68,6 +71,46 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpu'>
|
||||
<element name='cpu'>
|
||||
<ref name='cpuHost'/>
|
||||
<ref name='cpuHostModel'/>
|
||||
<ref name='cpuCustom'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpuHost'>
|
||||
<element name='mode'>
|
||||
<attribute name='name'>
|
||||
<value>host-passthrough</value>
|
||||
</attribute>
|
||||
<ref name='supported'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpuHostModel'>
|
||||
<element name='mode'>
|
||||
<attribute name='name'>
|
||||
<value>host-model</value>
|
||||
</attribute>
|
||||
<ref name='supported'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpuCustom'>
|
||||
<element name='mode'>
|
||||
<attribute name='name'>
|
||||
<value>custom</value>
|
||||
</attribute>
|
||||
<ref name='supported'/>
|
||||
<zeroOrMore>
|
||||
<element name='model'>
|
||||
<text/>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='devices'>
|
||||
<element name='devices'>
|
||||
<interleave>
|
||||
|
||||
Reference in New Issue
Block a user