From patchwork Wed Jun 29 18:02:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 929942 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5TI4oQr001084 for ; Wed, 29 Jun 2011 18:04:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757273Ab1F2SEq (ORCPT ); Wed, 29 Jun 2011 14:04:46 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:39723 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757135Ab1F2SEl (ORCPT ); Wed, 29 Jun 2011 14:04:41 -0400 Received: by mail-qy0-f174.google.com with SMTP id 29so2667320qyk.19 for ; Wed, 29 Jun 2011 11:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=XZqXiPdN8PRnXg0HyLgXao9OxBXFt0BA9LBuqsD+9Ig=; b=PF4yaLBMe37PFX9A4cVGlQ93GfOTC2ezH0YAAzReZtHA6lnldK1uXBRLC5603s1fwI WO/fR0M4VK4lji/KGDtZDMdEr4NNLGeQj79XFExBywe1ajyND7XZ4Ok9W8uIjbnYEnYw VKh+CaYE1rNoD3uYWhgI7P8GGEpil/ICy2xKw= Received: by 10.224.33.82 with SMTP id g18mr887569qad.105.1309370681431; Wed, 29 Jun 2011 11:04:41 -0700 (PDT) Received: from localhost.localdomain (c-71-232-157-243.hsd1.ma.comcast.net [71.232.157.243]) by mx.google.com with ESMTPS id e18sm1067677qcs.29.2011.06.29.11.04.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 11:04:40 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH 9/9] kvm tools: Stop VCPUs before freeing struct kvm Date: Wed, 29 Jun 2011 14:02:18 -0400 Message-Id: <1309370538-7947-9-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1309370538-7947-1-git-send-email-levinsasha928@gmail.com> References: <1309370538-7947-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Jun 2011 18:04:50 +0000 (UTC) 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);