From: Sasha Levin Subject: [PATCH 9/9] kvm tools: Stop VCPUs before freeing struct kvm Date: Sun, 3 Jul 2011 02:52:11 +0300 Message-ID: <1309650731-5796-9-git-send-email-levinsasha928@gmail.com> References: <1309650731-5796-1-git-send-email-levinsasha928@gmail.com> Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:37668 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752240Ab1GAXxt (ORCPT ); Fri, 1 Jul 2011 19:53:49 -0400 Received: by mail-ww0-f44.google.com with SMTP id 5so3645497wwe.1 for ; Fri, 01 Jul 2011 16:53:49 -0700 (PDT) In-Reply-To: <1309650731-5796-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Not stopping VCPUs before leads to seg faults and other errors due to synchronization between threads. Signed-off-by: Sasha Levin --- tools/kvm/term.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/term.c b/tools/kvm/term.c index a0cb03f..2a3e1f0 100644 --- a/tools/kvm/term.c +++ b/tools/kvm/term.c @@ -10,6 +10,7 @@ #include "kvm/term.h" #include "kvm/util.h" #include "kvm/kvm.h" +#include "kvm/kvm-cpu.h" extern struct kvm *kvm; static struct termios orig_term; @@ -34,6 +35,7 @@ int term_getc(int who) if (term_got_escape) { term_got_escape = false; if (c == 'x') { + kvm_cpu__reboot(); kvm__delete(kvm); printf("\n # KVM session terminated.\n"); exit(1); -- 1.7.6