From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] stop and show registers on error. Date: Mon, 21 Feb 2011 14:57:57 +0200 Message-ID: <20110221125757.GM14984@redhat.com> References: <20110221101654.GJ14984@redhat.com> <4D625973.5020405@redhat.com> <20110221122554.GK14984@redhat.com> <4D62603B.2020709@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , mtosatti@redhat.com, kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754926Ab1BUM6C (ORCPT ); Mon, 21 Feb 2011 07:58:02 -0500 Content-Disposition: inline In-Reply-To: <4D62603B.2020709@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Feb 21, 2011 at 01:53:15PM +0100, Jan Kiszka wrote: > On 2011-02-21 13:25, Gleb Natapov wrote: > > On Mon, Feb 21, 2011 at 02:24:19PM +0200, Avi Kivity wrote: > >> On 02/21/2011 12:16 PM, Gleb Natapov wrote: > >>> Signed-off-by: Gleb Natapov > >>> diff --git a/qemu-kvm.c b/qemu-kvm.c > >>> index 49cd683..2f3f683 100644 > >>> --- a/qemu-kvm.c > >>> +++ b/qemu-kvm.c > >>> @@ -644,8 +644,7 @@ int kvm_run(CPUState *env) > >>> break; > >>> #endif > >>> case KVM_EXIT_INTERNAL_ERROR: > >>> - kvm_handle_internal_error(env, run); > >>> - r = 1; > >>> + r = kvm_handle_internal_error(env, run); > >>> break; > >>> default: > >>> if (kvm_arch_run(env)) { > >>> @@ -1233,6 +1232,7 @@ int kvm_cpu_exec(CPUState *env) > >>> r = kvm_run(env); > >>> if (r< 0) { > >>> printf("kvm_run returned %d\n", r); > >>> + kvm_show_regs(env); > >>> vm_stop(0); > >>> } > >> > >> 'info registers'. > >> > > That is if you can reproduce. For useful bug reports it is better to > > have them printed for user. > > FWIW, this patch just aligns qemu-kvm to what upstream already does and > what qemu-kvm will soon or later do as well when it starts using the > upstream loop. I'm neutral /wrt applying this patch before the cleanup > or achieving the same by consolidating the code. > Indeed. When I got no register dump on error I stared at the wrong code for 20 minutes trying to understand how it could happen. Having two kvm implementations in the same tree is such fun! -- Gleb.