From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui1QG-0007iP-Q6 for qemu-devel@nongnu.org; Thu, 30 May 2013 07:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui1QA-0000N7-4y for qemu-devel@nongnu.org; Thu, 30 May 2013 07:53:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui1Q9-0000Mu-TU for qemu-devel@nongnu.org; Thu, 30 May 2013 07:53:30 -0400 Message-ID: <51A73E46.5050003@redhat.com> Date: Thu, 30 May 2013 13:55:50 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1369912840-18577-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1369912840-18577-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] gdbstub: do not restart crashed guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Jan Kiszka , qemu-devel@nongnu.org, Luiz Capitulino On 05/30/13 13:20, Paolo Bonzini wrote: > If a guest has crashed with an internal error or similar, detaching > gdb (or any other debugger action) should not restart it. > > Cc: Jan Kiszka > Signed-off-by: Paolo Bonzini > --- > gdbstub.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gdbstub.c b/gdbstub.c > index e80e1d3..90e54cb 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -371,7 +371,9 @@ static inline void gdb_continue(GDBState *s) > #ifdef CONFIG_USER_ONLY > s->running_state = 1; > #else > - vm_start(); > + if (runstate_check(RUN_STATE_DEBUG)) { > + vm_start(); > + } > #endif > } > > I sought to check the gdb_continue() call sites, and uses of RUN_STATE_DEBUG. Seems reasonable. Reviewed-by: Laszlo Ersek ( FWIW I wonder why in commit ad02b96a Luiz allowed DEBUG -> SUSPENDED. As far as I understand, when the debugger is attached, the guest is not running, hence it can't go directly to RUN_STATE_SUSPENDED. Maybe due to a concurrent monitor command? Technically it does seem possible; from main_loop_should_exit(): if (qemu_debug_requested()) { vm_stop(RUN_STATE_DEBUG); } if (qemu_suspend_requested()) { qemu_system_suspend(); } Both requests could become pending during one iteration of the loop, and the next iteration will see both of them. OK. ) Laszlo