domcaps: Add CPU usable flag

In case a hypervisor is able to tell us a list of supported CPU models
and whether each CPU models can be used on the current host, we can
propagate this to domain capabilities. This is a better alternative
to calling virConnectCompareCPU for each supported CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark
2016-06-15 16:15:44 +02:00
parent 33f9ccc141
commit d4c007e6d5
14 changed files with 213 additions and 168 deletions

View File

@@ -156,9 +156,9 @@
&lt;mode name='host-passthrough' supported='yes'/&gt;
&lt;mode name='host-model' supported='yes'/&gt;
&lt;mode name='custom' supported='yes'&gt;
&lt;model&gt;Broadwell&lt;/model&gt;
&lt;model&gt;Broadwell-noTSX&lt;/model&gt;
&lt;model&gt;Haswell&lt;/model&gt;
&lt;model usable='no'&gt;Broadwell&lt;/model&gt;
&lt;model usable='yes'&gt;Broadwell-noTSX&lt;/model&gt;
&lt;model usable='no'&gt;Haswell&lt;/model&gt;
...
&lt;/mode&gt;
&lt;/cpu&gt;
@@ -183,6 +183,10 @@
<dd>
The <code>mode</code> element contains a list of supported CPU
models, each described by a dedicated <code>model</code> element.
The <code>usable</code> attribute specifies whether the model can
be used on the host. A special value <code>unknown</code> indicates
libvirt does not have enough information to provide the usability
data.
</dd>
</dl>

View File

@@ -105,6 +105,13 @@
<ref name='supported'/>
<zeroOrMore>
<element name='model'>
<attribute name='usable'>
<choice>
<value>yes</value>
<value>no</value>
<value>unknown</value>
</choice>
</attribute>
<text/>
</element>
</zeroOrMore>