mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cpu: Optionally forbid fallback CPU models
In case a hypervisor doesn't support the exact CPU model requested by a domain XML, we automatically fallback to a closest CPU model the hypervisor supports (and make sure we add/remove any additional features if needed). This patch adds 'fallback' attribute to model element, which can be used to disable this automatic fallback.
This commit is contained in:
@@ -559,7 +559,7 @@
|
||||
<pre>
|
||||
...
|
||||
<cpu match='exact'>
|
||||
<model>core2duo</model>
|
||||
<model fallback='allow'>core2duo</model>
|
||||
<vendor>Intel</vendor>
|
||||
<topology sockets='1' cores='2' threads='1'/>
|
||||
<feature policy='disable' name='lahf_lm'/>
|
||||
@@ -609,7 +609,15 @@
|
||||
<dd>The content of the <code>model</code> element specifies CPU model
|
||||
requested by the guest. The list of available CPU models and their
|
||||
definition can be found in <code>cpu_map.xml</code> file installed
|
||||
in libvirt's data directory.</dd>
|
||||
in libvirt's data directory. If a hypervisor is not able to use the
|
||||
exact CPU model, libvirt automatically falls back to a closest model
|
||||
supported by the hypervisor while maintaining the list of CPU
|
||||
features. <span class="since">Since 0.9.10</span>, an optional
|
||||
<code>fallback</code> attribute can be used to forbid this behavior,
|
||||
in which case an attempt to start a domain requesting an unsupported
|
||||
CPU model will fail. Supported values for <code>fallback</code>
|
||||
attribute are: <code>allow</code> (this is the default), and
|
||||
<code>forbid</code>.</dd>
|
||||
|
||||
<dt><code>vendor</code></dt>
|
||||
<dd><span class="since">Since 0.8.3</span> the content of the
|
||||
|
||||
@@ -2571,6 +2571,14 @@
|
||||
|
||||
<define name="cpuModel">
|
||||
<element name="model">
|
||||
<optional>
|
||||
<attribute name="fallback">
|
||||
<choice>
|
||||
<value>allow</value>
|
||||
<value>forbid</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<text/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
Reference in New Issue
Block a user