From patchwork Mon Jul 11 19:49:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 966232 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 p6BJnWEr001128 for ; Mon, 11 Jul 2011 19:49:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757918Ab1GKTta (ORCPT ); Mon, 11 Jul 2011 15:49:30 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:39653 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757774Ab1GKTta (ORCPT ); Mon, 11 Jul 2011 15:49:30 -0400 Received: by wwe5 with SMTP id 5so4248944wwe.1 for ; Mon, 11 Jul 2011 12:49:29 -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; bh=uYmD6tDjYSN0FkvDugD080ZMnCQJ93scNy8mYJo6VIs=; b=jCxXDO6KVjLNujUtZdRXoid7IvpHqAB7cu0pA1VnbpIXl4qXz7EIsPELbx7Jxt3++H 2rVl+NDbzQ6TsMaHA+Iu5FVOj1GUIcy1t7FgjiXanpiNfUaoRlgO5XMOalzhGdp/dlH5 bjUZ/e5Q5YNAx6m8lsSuGWQnNMgCLWtB+In2k= Received: by 10.227.127.135 with SMTP id g7mr4710616wbs.96.1310413769101; Mon, 11 Jul 2011 12:49:29 -0700 (PDT) Received: from localhost.localdomain ([31.210.184.36]) by mx.google.com with ESMTPS id gg16sm10289693wbb.0.2011.07.11.12.49.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 12:49:28 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: mingo@elte.hu, asias.hejun@gmail.com, prasadjoshi124@gmail.com, gorcunov@gmail.com, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH] kvm tools: Wait for VCPU to reboot before returning Date: Mon, 11 Jul 2011 22:49:06 +0300 Message-Id: <1310413746-1530-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.6 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]); Mon, 11 Jul 2011 19:49:34 +0000 (UTC) Wait until all VCPU threads have received the reboot signal and have exited. This prevents the occasional error messages when exiting kvm tools with the ctrl a + x combo. Reported-by: Asias He Signed-off-by: Sasha Levin --- tools/kvm/kvm-cpu.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c index 2f5d23c..5825ac9 100644 --- a/tools/kvm/kvm-cpu.c +++ b/tools/kvm/kvm-cpu.c @@ -422,6 +422,7 @@ static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu) void kvm_cpu__reboot(void) { pthread_kill(kvm_cpus[0]->thread, SIGKVMEXIT); + pthread_join(kvm_cpus[0]->thread, NULL); } int kvm_cpu__start(struct kvm_cpu *cpu)