public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org
Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com,
	gorcunov@gmail.com, prasadjoshi124@gmail.com,
	Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 9/9] kvm tools: Stop VCPUs before freeing struct kvm
Date: Wed, 29 Jun 2011 14:02:18 -0400	[thread overview]
Message-ID: <1309370538-7947-9-git-send-email-levinsasha928@gmail.com> (raw)
In-Reply-To: <1309370538-7947-1-git-send-email-levinsasha928@gmail.com>

Not stopping VCPUs before leads to seg faults and other errors due to
synchronization between threads.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 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


  parent reply	other threads:[~2011-06-29 18:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 18:02 [PATCH 1/9] kvm tools: Don't dynamically allocate threadpool jobs Sasha Levin
2011-06-29 18:02 ` [PATCH 2/9] kvm tools: Process virtio-blk requests in parallel Sasha Levin
2011-06-29 18:02 ` [PATCH 3/9] kvm tools: Allow giving instance names Sasha Levin
2011-06-30  7:53   ` Pekka Enberg
2011-06-30  8:30     ` Avi Kivity
2011-06-30 15:00       ` Sasha Levin
2011-06-30 15:03         ` Avi Kivity
2011-06-30 15:03     ` Sasha Levin
2011-06-29 18:02 ` [PATCH 4/9] kvm tools: Provide instance name when running 'kvm debug' Sasha Levin
2011-06-29 18:02 ` [PATCH 5/9] kvm tools: Provide instance name when running 'kvm pause' Sasha Levin
2011-06-29 18:02 ` [PATCH 6/9] kvm tools: Add virtio-balloon device Sasha Levin
2011-06-29 18:02 ` [PATCH 7/9] kvm tools: Advise memory allocated for guest RAM as KSM mergable Sasha Levin
2011-06-29 18:02 ` [PATCH 8/9] kvm tools: Add 'kvm balloon' command Sasha Levin
2011-06-29 18:02 ` Sasha Levin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-02 23:52 [PATCH v2 1/8] kvm tools: Don't dynamically allocate threadpool jobs Sasha Levin
2011-07-02 23:52 ` [PATCH 9/9] kvm tools: Stop VCPUs before freeing struct kvm Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309370538-7947-9-git-send-email-levinsasha928@gmail.com \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox