From: Marcelo Tosatti <mtosatti@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: kvm list <kvm@vger.kernel.org>,
Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel <qemu-devel@nongnu.org>,
Gleb Natapov <gleb@redhat.com>,
"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] [RESEND][PATCH 2/2 v3] deal with guest panicked event
Date: Fri, 9 Mar 2012 19:22:56 -0300 [thread overview]
Message-ID: <20120309222256.GA24975@amt.cnet> (raw)
In-Reply-To: <20120308115656.GD25529@redhat.com>
On Thu, Mar 08, 2012 at 11:56:56AM +0000, Daniel P. Berrange wrote:
> On Thu, Mar 08, 2012 at 01:52:45PM +0200, Avi Kivity wrote:
> > On 03/08/2012 01:36 PM, Daniel P. Berrange wrote:
> > > On Thu, Mar 08, 2012 at 01:28:56PM +0200, Avi Kivity wrote:
> > > > On 03/08/2012 12:15 PM, Wen Congyang wrote:
> > > > > When the host knows the guest is panicked, it will set
> > > > > exit_reason to KVM_EXIT_GUEST_PANICKED. So if qemu receive
> > > > > this exit_reason, we can send a event to tell management
> > > > > application that the guest is panicked and set the guest
> > > > > status to RUN_STATE_PANICKED.
> > > > >
> > > > > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> > > > > ---
> > > > > kvm-all.c | 5 +++++
> > > > > monitor.c | 3 +++
> > > > > monitor.h | 1 +
> > > > > qapi-schema.json | 2 +-
> > > > > qmp.c | 3 ++-
> > > > > vl.c | 1 +
> > > > > 6 files changed, 13 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/kvm-all.c b/kvm-all.c
> > > > > index 77eadf6..b3c9a83 100644
> > > > > --- a/kvm-all.c
> > > > > +++ b/kvm-all.c
> > > > > @@ -1290,6 +1290,11 @@ int kvm_cpu_exec(CPUState *env)
> > > > > (uint64_t)run->hw.hardware_exit_reason);
> > > > > ret = -1;
> > > > > break;
> > > > > + case KVM_EXIT_GUEST_PANICKED:
> > > > > + monitor_protocol_event(QEVENT_GUEST_PANICKED, NULL);
> > > > > + vm_stop(RUN_STATE_PANICKED);
> > > > > + ret = -1;
> > > > > + break;
> > > > >
> > > >
> > > > If the management application is not aware of this event, then it will
> > > > never resume the guest, so it will appear hung.
> > >
> > > Even if the mgmt app doesn't know about the QEVENT_GUEST_PANICKED, it should
> > > still see a QEVENT_STOP event emitted by vm_stop() surely ? So it will
> > > know the guest CPUs have been stopped, even if it isn't aware of the
> > > reason why, which seems fine to me.
> >
> > No. The guest is stopped, and there's no reason to suppose that the
> > management app will restart it. Behaviour has changed.
> >
> > Suppose the guest has reboot_on_panic set; now the behaviour change is
> > even more visible - service will stop completely instead of being
> > interrupted for a bit while the guest reboots.
>
> Hmm, so this calls for a new command line argument to control behaviour,
> similar to what we do for disk werror, eg something like
>
> --onpanic "report|pause|stop|..."
>
> where
>
> report - emit QEVENT_GUEST_PANICKED only
Should be the default.
> pause - emit QEVENT_GUEST_PANICKED and pause VM
> stop - emit QEVENT_GUEST_PANICKED and quit VM
"quit" is a better name than "stop".
> This would map fairly well into libvirt, where we already have config
> parameters for controlling what todo with a guest when it panics.
>
> Regards,
> Daniel
next prev parent reply other threads:[~2012-03-09 22:26 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 7:57 [Qemu-devel] [PATCH 0/2 v3] kvm: notify host when guest panicked Wen Congyang
2012-03-08 8:02 ` [Qemu-devel] [PATCH 1/2 " Wen Congyang
2012-03-08 8:04 ` [Qemu-devel] [PATCH 2/2 v3] kvm: set exit_reason to KVM_EXIT_GUEST_PANICKED " Wen Congyang
2012-03-08 8:06 ` [Qemu-devel] [PATCH 1/2 v3] update linux-headers Wen Congyang
2012-03-08 8:07 ` [Qemu-devel] [PATCH 2/2 v3] deal with guest panicked event Wen Congyang
2012-03-08 10:08 ` Jan Kiszka
2012-03-08 10:11 ` Wen Congyang
2012-03-08 10:15 ` [Qemu-devel] [RESEND][PATCH " Wen Congyang
2012-03-08 11:28 ` Avi Kivity
2012-03-08 11:36 ` Daniel P. Berrange
2012-03-08 11:52 ` Avi Kivity
2012-03-08 11:56 ` Daniel P. Berrange
2012-03-09 22:22 ` Marcelo Tosatti [this message]
2012-03-21 19:01 ` Anthony Liguori
2012-03-12 1:46 ` Wen Congyang
2012-03-08 11:13 ` [Qemu-devel] [PATCH 0/2 v3] kvm: notify host when guest panicked Avi Kivity
2012-03-09 1:21 ` Wen Congyang
2012-03-12 9:04 ` Wen Congyang
2012-03-12 10:33 ` Avi Kivity
2012-03-13 6:44 ` Wen Congyang
2012-03-13 8:54 ` Avi Kivity
2012-03-13 9:18 ` Daniel P. Berrange
2012-03-13 10:47 ` Avi Kivity
2012-03-14 8:29 ` Wen Congyang
2012-03-14 9:24 ` Avi Kivity
2012-03-14 9:53 ` Wen Congyang
2012-03-14 10:07 ` Avi Kivity
2012-03-14 10:26 ` Wen Congyang
2012-03-14 10:29 ` Avi Kivity
2012-03-14 10:46 ` Gleb Natapov
2012-03-14 10:48 ` Avi Kivity
2012-03-14 11:11 ` Wen Congyang
2012-03-14 13:07 ` Avi Kivity
2012-03-14 13:13 ` Avi Kivity
2012-03-14 13:14 ` Gleb Natapov
2012-03-14 13:16 ` Avi Kivity
2012-03-14 13:25 ` Gleb Natapov
2012-03-14 18:46 ` Eric Northup
2012-03-15 7:01 ` Wen Congyang
2012-03-15 10:39 ` Gleb Natapov
2012-03-15 11:25 ` Jan Kiszka
2012-03-15 11:46 ` Avi Kivity
2012-03-16 8:05 ` Wen Congyang
2012-03-21 19:12 ` Anthony Liguori
2012-03-22 8:34 ` Wen Congyang
2012-03-14 18:47 ` Eric Northup
2012-03-14 10:37 ` Amit Shah
2012-03-14 10:52 ` Wen Congyang
2012-03-14 10:52 ` Gleb Natapov
2012-03-14 10:57 ` Wen Congyang
2012-03-14 10:58 ` Gleb Natapov
2012-03-14 11:13 ` Wen Congyang
2012-03-14 10:52 ` Avi Kivity
2012-03-14 10:58 ` Wen Congyang
2012-03-14 10:59 ` Daniel P. Berrange
2012-03-14 11:06 ` Wen Congyang
2012-03-14 11:11 ` Gleb Natapov
2012-03-14 11:17 ` Daniel P. Berrange
2012-03-14 10:59 ` Gleb Natapov
2012-03-14 10:57 ` Amit Shah
2012-03-14 9:51 ` Amit Shah
2012-03-14 10:04 ` Wen Congyang
2012-03-14 10:08 ` Avi Kivity
2012-03-14 10:40 ` Amit Shah
2012-03-14 10:42 ` Gleb Natapov
2012-03-14 10:57 ` Daniel P. Berrange
2012-03-14 11:01 ` Wen Congyang
2012-03-21 19:04 ` Anthony Liguori
2012-03-22 7:33 ` Gleb Natapov
2012-03-12 10:31 ` Avi Kivity
2012-03-19 7:33 ` Wen Congyang
2012-03-20 9:59 ` Wen Congyang
2012-03-20 15:45 ` Gleb Natapov
2012-03-21 0:56 ` Wen Congyang
2012-03-21 9:11 ` Gleb Natapov
2012-03-21 9:35 ` Wen Congyang
2012-03-21 9:42 ` Gleb Natapov
2012-03-21 16:18 ` Corey Minyard
2012-03-21 16:24 ` Gleb Natapov
2012-03-21 16:25 ` Avi Kivity
2012-03-21 17:04 ` Daniel P. Berrange
2012-03-21 17:34 ` Avi Kivity
2012-03-21 18:17 ` Jan Kiszka
2012-03-21 19:19 ` Anthony Liguori
2012-03-22 1:05 ` Wen Congyang
2012-03-22 7:31 ` Gleb Natapov
2012-03-22 7:44 ` Wen Congyang
2012-03-22 8:36 ` Gleb Natapov
2012-03-22 7:28 ` Gleb Natapov
2012-03-22 7:40 ` Wen Congyang
2012-04-02 10:05 ` Wen Congyang
2012-04-02 10:54 ` Amit Shah
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=20120309222256.GA24975@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=berrange@redhat.com \
--cc=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
/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).