From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wen Congyang Subject: Re: [Qemu-devel] [PATCH]qemu: deal with guest paniced event Date: Fri, 02 Mar 2012 08:40:08 +0800 Message-ID: <4F5016E8.9090206@cn.fujitsu.com> References: <4F4AF1FB.6000903@cn.fujitsu.com> <4F4AF316.50400@cn.fujitsu.com> <20120301135139.5f2b2a5c@doriath.home> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm list , Avi Kivity , KAMEZAWA Hiroyuki , "Daniel P. Berrange" , linux-kernel@vger.kernel.org, qemu-devel To: Luiz Capitulino Return-path: In-Reply-To: <20120301135139.5f2b2a5c@doriath.home> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org At 03/02/2012 12:51 AM, Luiz Capitulino Wrote: > On Mon, 27 Feb 2012 11:05:58 +0800 > Wen Congyang wrote: > >> When the host knows the guest is paniced, it will set >> exit_reason to KVM_EXIT_GUEST_PANIC. So if qemu receive >> this exit_reason, we can send a event to tell management >> application that the guest is paniced. >> >> Signed-off-by: Wen Congyang >> --- >> kvm-all.c | 3 +++ >> linux-headers/linux/kvm.h | 1 + >> monitor.c | 3 +++ >> monitor.h | 1 + >> 4 files changed, 8 insertions(+), 0 deletions(-) >> >> diff --git a/kvm-all.c b/kvm-all.c >> index c4babda..ae428ab 100644 >> --- a/kvm-all.c >> +++ b/kvm-all.c >> @@ -1190,6 +1190,9 @@ int kvm_cpu_exec(CPUState *env) >> (uint64_t)run->hw.hardware_exit_reason); >> ret = -1; >> break; >> + case KVM_EXIT_GUEST_PANIC: >> + monitor_protocol_event(QEVENT_GUEST_PANICED, NULL); >> + break; > > The event alone is not enough, because the mngt app may miss it (eg. the panic > happens before the mngt app connected to qemu). > > A simple way to solve this would be to also add a new RunState called > guest-panic and make the transition to it (besides sending the event). > > A more general way would be to model this after -drive's werror/rerror options, > say guest-error=report|ignore|stop. When guest-error=stop, the mngt app will > get a STOP event and can check the VM runstate to know if it's guest-panic. OK, I will fix it. Thanks Wen Congyang > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3GWQ-0006tw-Ak for qemu-devel@nongnu.org; Thu, 01 Mar 2012 19:38:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3GWN-0001fi-P7 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 19:38:57 -0500 Received: from [222.73.24.84] (port=50031 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3GWN-0001WL-DX for qemu-devel@nongnu.org; Thu, 01 Mar 2012 19:38:55 -0500 Message-ID: <4F5016E8.9090206@cn.fujitsu.com> Date: Fri, 02 Mar 2012 08:40:08 +0800 From: Wen Congyang MIME-Version: 1.0 References: <4F4AF1FB.6000903@cn.fujitsu.com> <4F4AF316.50400@cn.fujitsu.com> <20120301135139.5f2b2a5c@doriath.home> In-Reply-To: <20120301135139.5f2b2a5c@doriath.home> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH]qemu: deal with guest paniced event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kvm list , qemu-devel , linux-kernel@vger.kernel.org, Avi Kivity , KAMEZAWA Hiroyuki At 03/02/2012 12:51 AM, Luiz Capitulino Wrote: > On Mon, 27 Feb 2012 11:05:58 +0800 > Wen Congyang wrote: > >> When the host knows the guest is paniced, it will set >> exit_reason to KVM_EXIT_GUEST_PANIC. So if qemu receive >> this exit_reason, we can send a event to tell management >> application that the guest is paniced. >> >> Signed-off-by: Wen Congyang >> --- >> kvm-all.c | 3 +++ >> linux-headers/linux/kvm.h | 1 + >> monitor.c | 3 +++ >> monitor.h | 1 + >> 4 files changed, 8 insertions(+), 0 deletions(-) >> >> diff --git a/kvm-all.c b/kvm-all.c >> index c4babda..ae428ab 100644 >> --- a/kvm-all.c >> +++ b/kvm-all.c >> @@ -1190,6 +1190,9 @@ int kvm_cpu_exec(CPUState *env) >> (uint64_t)run->hw.hardware_exit_reason); >> ret = -1; >> break; >> + case KVM_EXIT_GUEST_PANIC: >> + monitor_protocol_event(QEVENT_GUEST_PANICED, NULL); >> + break; > > The event alone is not enough, because the mngt app may miss it (eg. the panic > happens before the mngt app connected to qemu). > > A simple way to solve this would be to also add a new RunState called > guest-panic and make the transition to it (besides sending the event). > > A more general way would be to model this after -drive's werror/rerror options, > say guest-error=report|ignore|stop. When guest-error=stop, the mngt app will > get a STOP event and can check the VM runstate to know if it's guest-panic. OK, I will fix it. Thanks Wen Congyang > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >