Subject: [PATCH 75/81] gdbstub: do not restart crashed guest

From: Marcel Apfelbaum <[email-masked]>
Date: Wed, 6 Nov 2013 16:32:34 +0100

RH-Author: Marcel Apfelbaum <[email-masked]>
Message-id: <[email-masked]>
Patchwork-id: 55551
O-Subject: [RHEL-7 qemu-kvm PATCH v3 6/9] gdbstub: do not restart crashed guest
Bugzilla: 990601
RH-Acked-by: Paolo Bonzini <[email-masked]>
RH-Acked-by: Michael S. Tsirkin <[email-masked]>
RH-Acked-by: Alex Williamson <[email-masked]>

From: Paolo Bonzini <[email-masked]>

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 <[email-masked]>
Signed-off-by: Paolo Bonzini <[email-masked]>
Reviewed-by: Laszlo Ersek <[email-masked]>
Message-id: [email-masked]
Signed-off-by: Anthony Liguori <[email-masked]>
(cherry picked from commit 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dc)
Signed-off-by: Marcel Apfelbaum <[email-masked]>
---
 gdbstub.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Signed-off-by: Miroslav Rezanina <[email-masked]>
---
 gdbstub.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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
 }
 
-- 
1.7.1