QEMU supports a bunch of CPUID features that are tied to the kvm CPUID
nodes rather than the processor's. They are "kvmclock",
"kvm_nopiodelay",
"kvm_mmu", "kvm_asyncpf". These are not known to libvirt and their
CPUID leaf might move if (for example) the Hyper-V extensions are enabled.
Hence their handling would anyway require some special-casing.
However, among these the most useful is kvmclock; an additional
"property" of this feature is that a <timer> element is a better model
than a CPUID feature.
This is what this series does.
Actually, while working on this I noticed that it is quite difficult
to have round-trip testcases involving -cpu, that can be used with
both qemuargv2xmltest and qemuxml2argvtest. This is what the first
five four patches do. The first patch is unrelated. The second patch
updates the CPU feature map with default CPUs, and is a prerequisite
for patch 3. That one makes the -cpu parsing code detect the "lm"
CPU feature, so that the guest arch is correctly set to either
i686 or x86_64.
The fifth patch is also mostly needed for testing. It notices the
default models qemu32/qemu64 and does not generate <cpu> elements;
this happens with "-cpu qemu32,-kvmclock" for example. Then, the
last two patches actually add the new feature.
Paolo Bonzini (7):
qemu: parse -enable-kvm
x86: add kvm32 and kvm64, update qemu64
qemu: detect arch correctly for KVM
qemu: get arch name from <cpu> element
qemu: do not create useless <cpu> element
conf: add kvmclock timer
qemu: parse and create -cpu ...,-kvmclock
v1->v2: completely redone first patch (which became patches 1-5 :)
docs/formatdomain.html.in | 4 +-
docs/schemas/domaincommon.rng | 3 +-
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/cpu/cpu_map.xml | 31 +++++
src/qemu/qemu_command.c | 129 ++++++++++++++++++--
tests/qemuargv2xmltest.c | 4 +
.../qemuxml2argv-cpu-host-kvmclock.args | 4 +
.../qemuxml2argv-cpu-host-kvmclock.xml | 23 ++++
.../qemuxml2argv-cpu-kvmclock.args | 4 +
.../qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml | 24 ++++
tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args | 4 +
tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml | 21 +++
tests/qemuxml2argvtest.c | 3 +
tests/qemuxml2xmltest.c | 3 +
15 files changed, 244 insertions(+), 17 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml
--
1.7.7.6