From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5bdw-0001Ex-8t for qemu-devel@nongnu.org; Thu, 08 Mar 2012 06:36:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5bdp-00089o-F7 for qemu-devel@nongnu.org; Thu, 08 Mar 2012 06:36:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5bdp-00089c-85 for qemu-devel@nongnu.org; Thu, 08 Mar 2012 06:36:17 -0500 Date: Thu, 8 Mar 2012 11:36:07 +0000 From: "Daniel P. Berrange" Message-ID: <20120308113607.GC25529@redhat.com> References: <4F58664D.1070800@cn.fujitsu.com> <4F5868C4.2090509@cn.fujitsu.com> <4F5886C4.7040100@cn.fujitsu.com> <4F5897F8.6090503@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4F5897F8.6090503@redhat.com> Subject: Re: [Qemu-devel] [RESEND][PATCH 2/2 v3] deal with guest panicked event Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: kvm list , Jan Kiszka , "linux-kernel@vger.kernel.org" , Gleb Natapov , qemu-devel , KAMEZAWA Hiroyuki 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 > > --- > > 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. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|