qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Eric B Munson <emunson@mgebm.net>
Cc: "ryanh@linux.vnet.ibm.com" <ryanh@linux.vnet.ibm.com>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V3] Guest stop notification
Date: Fri, 02 Dec 2011 21:20:43 +0100	[thread overview]
Message-ID: <4ED9331B.9060708@web.de> (raw)
In-Reply-To: <1322853560-24152-1-git-send-email-emunson@mgebm.net>

[-- Attachment #1: Type: text/plain, Size: 2686 bytes --]

On 2011-12-02 20:19, 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.
> 
> Signed-off-by: Eric B Munson <emunson@mgebm.net>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: ryanh@linux.vnet.ibm.com
> Cc: aliguori@us.ibm.com
> Cc: kvm@vger.kernel.org
> 
> ---
> 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 |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/kvmclock.c b/hw/kvmclock.c
> index 5388bc4..756839f 100644
> --- a/hw/kvmclock.c
> +++ b/hw/kvmclock.c
> @@ -16,6 +16,7 @@
>  #include "sysbus.h"
>  #include "kvm.h"
>  #include "kvmclock.h"
> +#include "cpu-all.h"
>  
>  #include <linux/kvm.h>
>  #include <linux/kvm_para.h>
> @@ -69,11 +70,34 @@ static void kvmclock_vm_state_change(void *opaque, int running,
>      }
>  }
>  
> +static void kvmclock_vm_state_change_vcpu(void *opaque, int running,
> +                                          RunState state)
> +{
> +    int ret;
> +    CPUState *penv = first_cpu;
> +
> +    if (running) {
> +	while (penv) {

or: for (cpu = first_cpu; cpu != NULL; cpu = cpu->next_cpu) {

> +            ret = kvm_vcpu_ioctl(penv, KVM_GUEST_PAUSED, 0);
> +            if (ret) {
> +                if (ret != ENOSYS) {
> +                    fprintf(stderr,
> +                            "kvmclock_vm_state_change_vcpu: %s\n",
> +                            strerror(-ret));
> +                }
> +                return;
> +            }
> +            penv = (CPUState *)penv->next_cpu;

Unneeded cast.

> +        }
> +    }
> +}
> +

Again: please use checkpatch.pl.

>  static int kvmclock_init(SysBusDevice *dev)
>  {
>      KVMClockState *s = FROM_SYSBUS(KVMClockState, dev);
>  
>      qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s);
> +    qemu_add_vm_change_state_handler(kvmclock_vm_state_change_vcpu, NULL);
>      return 0;
>  }
>  

Why not extend the existing handler?

I still wonder if the IOCTL interface is actually kvmclock specific. But
Marcello asked for this, and we could still change it when some arch
comes around that provides it independent of kvmclock.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2011-12-02 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 19:19 [Qemu-devel] [PATCH V3] Guest stop notification Eric B Munson
2011-12-02 20:20 ` Jan Kiszka [this message]
2011-12-02 21:27   ` Eric B Munson
2011-12-03  9:06     ` Jan Kiszka
2011-12-03 11:19       ` Marcelo Tosatti
2011-12-03 11:25         ` Jan Kiszka
2011-12-03 11:42           ` Marcelo Tosatti
2011-12-03 11:45             ` Jan Kiszka
2011-12-05 13:35               ` Marcelo Tosatti
2011-12-05 13:46                 ` Jan Kiszka
2011-12-05 12:58       ` Eric B Munson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED9331B.9060708@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=emunson@mgebm.net \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).