qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V7] Guest stop notification


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH V7] Guest stop notification
Date: Fri, 27 Jan 2012 14:48:26 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 01/17/2012 12:27 PM, Eric B Munson wrote:
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<address@hidden>

Cc: Avi Kivity<address@hidden>
Cc: Marcelo Tosatti<address@hidden>
Cc: Jan Kiszka<address@hidden>
Cc: address@hidden
Cc: address@hidden
Cc: address@hidden
---
Changes from V6:
  Remove unnecessary include

Changes from V5:
  KVM_GUEST_PAUSED is now a per vm ioctl instead of per vcpu

Changes from V4:
  Test if the guest paused capability is available before use

Changes from V3:
  Collapse new state change notification function into existsing function.
  Correct whitespace issues
  Change ioctl name to KVMCLOCK_GUEST_PAUSED
  Use for loop to iterate vpcu's

Changes from V2:
  Move ioctl into hw/kvmclock.c so as other arches can use it as it is
implemented

Changes from V1:
  Remove unnecessary encapsulating function

  hw/kvmclock.c |   11 +++++++++++
  1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/kvmclock.c b/hw/kvmclock.c
index 3b9fb20..ad79f52 100644
--- a/hw/kvmclock.c
+++ b/hw/kvmclock.c
@@ -64,10 +64,21 @@ static int kvmclock_post_load(void *opaque, int version_id)
  static void kvmclock_vm_state_change(void *opaque, int running,
                                       RunState state)
  {
+    int ret;
      KVMClockState *s = opaque;
+    int cap_guest_paused = kvm_check_extension(kvm_state, 
KVM_CAP_GUEST_PAUSED);

      if (running) {
          s->clock_valid = false;
+
+        if (!cap_guest_paused) {
+            return;
+        }
+
+        ret = kvm_vm_ioctl(kvm_state, KVMCLOCK_GUEST_PAUSED, 0);
+        if (ret) {
+            fprintf(stderr, "kvmclock_vm_state_change: %s\n", strerror(-ret));
+        }
      }
  }


This change looks harmless enough. What's the state of the kernel bits? I would expect this through uq/master.

Regards,

Anthony Liguori






reply via email to

[Prev in Thread] Current Thread [Next in Thread]