
On 01/06/2012 08:04 AM, Jiri Denemark wrote:
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. --- docs/formatdomain.html.in | 12 +++- docs/schemas/domaincommon.rng | 8 ++ src/conf/cpu_conf.c | 38 ++++++++- src/conf/cpu_conf.h | 10 +++ src/cpu/cpu_x86.c | 17 ++++- src/qemu/qemu_command.c | 1 + tests/cputest.c | 2 +
The meat of the patch, followed by lots of mechanical fallout...
tests/cputestdata/x86-baseline-1-result.xml | 2 +- tests/cputestdata/x86-baseline-2-result.xml | 2 +- .../cputestdata/x86-baseline-no-vendor-result.xml | 2 +- .../x86-baseline-some-vendors-result.xml | 2 +- tests/cputestdata/x86-guest-nofallback.xml | 18 ++++ .../cputestdata/x86-host+guest,model486-result.xml | 2 +- .../x86-host+guest,models,Penryn-result.xml | 2 +- .../x86-host+guest,models,qemu64-result.xml | 2 +- tests/cputestdata/x86-host+guest,models-result.xml | 2 +- tests/cputestdata/x86-host+guest-result.xml | 2 +- tests/cputestdata/x86-host+guest.xml | 2 +- tests/cputestdata/x86-host+min.xml | 2 +- .../cputestdata/x86-host+nehalem-force-result.xml | 2 +- tests/cputestdata/x86-host+pentium3.xml | 2 +- .../x86-host+strict-force-extra-result.xml | 2 +- .../x86-host-better+pentium3,core2duo-result.xml | 2 +- .../x86-host-better+pentium3,pentium3-result.xml | 2 +- .../x86-host-better+pentium3-result.xml | 2 +- tests/cputestdata/x86-host-worse+guest-result.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 2 +- .../qemuxml2argv-cpu-exact2-nofallback.args | 4 +
I guess adding the new attribute on output even if it matches the default when the attribute was omitted on input is reasonable.
@@ -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> optional
grammar: s/0.9.10 optional/0.9.10, an optional/ I'm not sure whether the ',' in the above replacement belongs inside or outside the <span>. ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org