All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: kvm list <kvm@vger.kernel.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Avi Kivity <avi@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH v2] deal with guest paniced event
Date: Wed, 07 Mar 2012 10:53:47 +0100	[thread overview]
Message-ID: <4F57302B.1040505@siemens.com> (raw)
In-Reply-To: <4F56C0E1.1090703@cn.fujitsu.com>

On 2012-03-07 02:58, Wen Congyang wrote:
> When the host knows the guest is paniced, it will set
> exit_reason to KVM_EXIT_GUEST_PANICED. So if qemu receive
> this exit_reason, we can send a event to tell management
> application that the guest is paniced and set the guest
> status to RUN_STATE_PANICED.
> 
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>  kvm-all.c                 |    4 ++++
>  linux-headers/linux/kvm.h |    1 +
>  monitor.c                 |    3 +++
>  monitor.h                 |    1 +
>  qapi-schema.json          |    2 +-
>  qmp.c                     |    3 ++-
>  vl.c                      |    1 +
>  7 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index c4babda..d356948 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1190,6 +1190,10 @@ int kvm_cpu_exec(CPUState *env)
>                      (uint64_t)run->hw.hardware_exit_reason);
>              ret = -1;
>              break;
> +        case KVM_EXIT_GUEST_PANICED:
> +            monitor_protocol_event(QEVENT_GUEST_PANICED, NULL);
> +            vm_stop(RUN_STATE_PANICED);
> +            break;

This cannot work. You missed to set ret to -1 to break out of loop.

>          case KVM_EXIT_INTERNAL_ERROR:
>              ret = kvm_handle_internal_error(env, run);
>              break;
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index f6b5343..ddc9716 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -163,6 +163,7 @@ struct kvm_pit_config {
>  #define KVM_EXIT_OSI              18
>  #define KVM_EXIT_PAPR_HCALL	  19
>  #define KVM_EXIT_S390_UCONTROL	  20
> +#define KVM_EXIT_GUEST_PANICED	  21

Linux header must be sync'ed in a separate patch, referencing the
upstream (typically kvm.git) commit hash that was used as base. Make
sure to use the update-linux-headers.sh script for this.

So the ordering is: Get the kernel changes accepted, then push the
(final) user space patches. That said, a patch like this can still be
posted in advance for informational purposes, but not for application.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: Gleb Natapov <gleb@redhat.com>, kvm list <kvm@vger.kernel.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Avi Kivity <avi@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH v2] deal with guest paniced event
Date: Wed, 07 Mar 2012 10:53:47 +0100	[thread overview]
Message-ID: <4F57302B.1040505@siemens.com> (raw)
In-Reply-To: <4F56C0E1.1090703@cn.fujitsu.com>

On 2012-03-07 02:58, Wen Congyang wrote:
> When the host knows the guest is paniced, it will set
> exit_reason to KVM_EXIT_GUEST_PANICED. So if qemu receive
> this exit_reason, we can send a event to tell management
> application that the guest is paniced and set the guest
> status to RUN_STATE_PANICED.
> 
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>  kvm-all.c                 |    4 ++++
>  linux-headers/linux/kvm.h |    1 +
>  monitor.c                 |    3 +++
>  monitor.h                 |    1 +
>  qapi-schema.json          |    2 +-
>  qmp.c                     |    3 ++-
>  vl.c                      |    1 +
>  7 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index c4babda..d356948 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1190,6 +1190,10 @@ int kvm_cpu_exec(CPUState *env)
>                      (uint64_t)run->hw.hardware_exit_reason);
>              ret = -1;
>              break;
> +        case KVM_EXIT_GUEST_PANICED:
> +            monitor_protocol_event(QEVENT_GUEST_PANICED, NULL);
> +            vm_stop(RUN_STATE_PANICED);
> +            break;

This cannot work. You missed to set ret to -1 to break out of loop.

>          case KVM_EXIT_INTERNAL_ERROR:
>              ret = kvm_handle_internal_error(env, run);
>              break;
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index f6b5343..ddc9716 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -163,6 +163,7 @@ struct kvm_pit_config {
>  #define KVM_EXIT_OSI              18
>  #define KVM_EXIT_PAPR_HCALL	  19
>  #define KVM_EXIT_S390_UCONTROL	  20
> +#define KVM_EXIT_GUEST_PANICED	  21

Linux header must be sync'ed in a separate patch, referencing the
upstream (typically kvm.git) commit hash that was used as base. Make
sure to use the update-linux-headers.sh script for this.

So the ordering is: Get the kernel changes accepted, then push the
(final) user space patches. That said, a patch like this can still be
posted in advance for informational purposes, but not for application.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2012-03-07  9:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07  1:50 [PATCH 0/2 v2] kvm: notify host when guest paniced Wen Congyang
2012-03-07  1:50 ` [Qemu-devel] " Wen Congyang
2012-03-07  1:53 ` [PATCH 1/2 " Wen Congyang
2012-03-07  1:53   ` [Qemu-devel] " Wen Congyang
2012-03-07  1:56 ` [PATCH 2/2 v2] kvm: set exit_reason to KVM_EXIT_GUEST_PANICED " Wen Congyang
2012-03-07  1:56   ` [Qemu-devel] " Wen Congyang
2012-03-07  1:58 ` [PATCH v2] deal with guest paniced event Wen Congyang
2012-03-07  1:58   ` [Qemu-devel] " Wen Congyang
2012-03-07  2:40   ` Eric Blake
2012-03-07  2:40     ` [Qemu-devel] " Eric Blake
2012-03-07  2:40     ` Eric Blake
2012-03-07  2:45     ` Wen Congyang
2012-03-07  2:45       ` [Qemu-devel] " Wen Congyang
2012-03-07  2:45       ` Wen Congyang
2012-03-07  9:53   ` Jan Kiszka [this message]
2012-03-07  9:53     ` Jan Kiszka
2012-03-07 10:05     ` Wen Congyang
2012-03-07 10:05       ` [Qemu-devel] " Wen Congyang

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=4F57302B.1040505@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=berrange@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wency@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.