summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2012-04-07 06:17:47 +0530
committerMarcelo Tosatti <mtosatti@redhat.com>2012-04-12 19:01:42 -0300
commitf349c12c0434e29c79ecde89029320c4002f7253 (patch)
tree64e76c6ff7ae5f94d48dd5a6f83d29d42555ade9 /hw
parent9ab2195dcb2e7d202287b6db7cfaa4f9e01941f6 (diff)
downloadqemu-f349c12c0434e29c79ecde89029320c4002f7253.tar.gz
kvmclock: guest stop notification
Often when a guest is stopped from the qemu console, it will report spurious soft lockup warnings on resume. There are kernel patches being discussed that will give the host the ability to tell the guest that it is being stopped and should ignore the soft lockup warning that generates. This patch uses the qemu Notifier system to tell the guest it is about to be stopped. Signed-off-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/kvm/clock.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c
index 446bd62176..824b978397 100644
--- a/hw/kvm/clock.c
+++ b/hw/kvm/clock.c
@@ -65,9 +65,25 @@ static void kvmclock_vm_state_change(void *opaque, int running,
RunState state)
{
KVMClockState *s = opaque;
+ CPUArchState *penv = first_cpu;
+ int cap_clock_ctrl = kvm_check_extension(kvm_state, KVM_CAP_KVMCLOCK_CTRL);
+ int ret;
if (running) {
s->clock_valid = false;
+
+ if (!cap_clock_ctrl) {
+ return;
+ }
+ for (penv = first_cpu; penv != NULL; penv = penv->next_cpu) {
+ ret = kvm_vcpu_ioctl(penv, KVM_KVMCLOCK_CTRL, 0);
+ if (ret) {
+ if (ret != -EINVAL) {
+ fprintf(stderr, "%s: %s\n", __func__, strerror(-ret));
+ }
+ return;
+ }
+ }
}
}