Bug 783921
| Summary: | libvirt cannot disable kvmclock | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Paolo Bonzini <pbonzini> |
| Component: | libvirt | Assignee: | Martin Kletzander <mkletzan> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.2 | CC: | acathrow, dallan, dyuan, jdenemar, mzhan, rwu, yupzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.9.10-1.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-20 06:47:00 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This feature is now implemented upstream by v0.9.9-140-gb66d1be and v0.9.9-139-g5a137f3:
commit b66d1bef14739ab56ed9f430b4c4e5b89ed5ed12
Author: Paolo Bonzini <pbonzini>
Date: Fri Jan 27 14:49:52 2012 +0100
qemu: parse and create -cpu ...,-kvmclock
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. Although, creating part of the -cpu command-line
from something other than the <cpu> XML element introduces some
ugliness.
commit 5a137f3620af4f6fd4a4484c6d79af0748aec85e
Author: Paolo Bonzini <pbonzini>
Date: Fri Jan 27 14:49:51 2012 +0100
conf: add kvmclock timer
Add kvmclock timer to documentation, schema and parsers. Keep the
platform timer first since it is kind of special, and alphabetize
the others when possible (i.e. when it does not change the ABI).
Verified this bug with libvirt-0.9.10-1.el6
Steps:
1. For a shutdown guest,
# virsh edit guest
...
<clock offset='utc'>
<timer name='kvmclock' present='yes'/>
</clock>
...
2. # virsh start guest
# ps -ef |grep kvm
qemu 12826 1 43 04:56 ? 00:00:20 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -cpu qemu64,+kvmclock -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel62......
You can find '-cpu qemu64,+kvmclock' from qemu cmd. Also login the guest and check
# dmesg|grep kvm
kvm-clock: Using msrs 4b564d01 and 4b564d00
kvm-clock: cpu 0, msr 0:1c1df41, boot clock
kvm-clock: cpu 0, msr 0:2215f41, primary cpu clock
Switching to clocksource kvm-clock
3. # virsh destroy guest
# virsh edit guest
...
<clock offset='utc'>
<timer name='kvmclock' present='no'/>
</clock>
...
4. # virsh start guest
# ps -ef |grep kvm
qemu 13115 1 13 04:58 ? 00:00:00 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -cpu qemu64,-kvmclock -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel62
......
You can find '-cpu qemu64,-kvmclock' from qemu cmd. Also login the guest and check
# dmesg|grep kvm
nothing return.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html |
Description of problem: kvmclock is disabled using a fake CPU feature, but this feature obviously does not appear in libvirt's cpuid data files. Version-Release number of selected component (if applicable): 0.8.2-25.el5 None of these XML snippets work: <cpu mode='host-model'> <feature policy='disable' name='kvmclock'/> </cpu> <cpu mode='host-passthrough'> <feature policy='disable' name='kvmclock'/> </cpu> <cpu> <model>core2duo</model> <feature policy='disable' name='kvmclock'/> </cpu> A better fit is anyway the <timer> element: <clock> <timer name='kvmclock' present='yes'/> </clock>