From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5DZm-0002Zv-Qr for qemu-devel@nongnu.org; Wed, 07 Mar 2012 04:55:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5DZO-0007jH-9h for qemu-devel@nongnu.org; Wed, 07 Mar 2012 04:54:30 -0500 Received: from goliath.siemens.de ([192.35.17.28]:34896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5DZN-0007h1-W5 for qemu-devel@nongnu.org; Wed, 07 Mar 2012 04:54:06 -0500 Message-ID: <4F57302B.1040505@siemens.com> Date: Wed, 07 Mar 2012 10:53:47 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F56BEF2.4020405@cn.fujitsu.com> <4F56C0E1.1090703@cn.fujitsu.com> In-Reply-To: <4F56C0E1.1090703@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] deal with guest paniced event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Gleb Natapov , kvm list , qemu-devel , "linux-kernel@vger.kernel.org" , Avi Kivity , KAMEZAWA Hiroyuki 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 > --- > 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