From patchwork Thu May 2 13:35:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 240990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 769EC2C00CA for ; Thu, 2 May 2013 23:44:56 +1000 (EST) Received: from localhost ([::1]:58311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtoc-0006DJ-N6 for incoming@patchwork.ozlabs.org; Thu, 02 May 2013 09:44:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtgJ-00034Z-U4 for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXtg6-0004Zl-8v for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46648 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtg6-0004ZR-11 for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:06 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 86FA2A5591 for ; Thu, 2 May 2013 15:36:05 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 2 May 2013 15:35:54 +0200 Message-Id: <1367501755-32272-29-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1367501755-32272-1-git-send-email-afaerber@suse.de> References: <1367501755-32272-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 28/29] cpus: Fix pausing TCG CPUs while in vCPU thread X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Due to a preceding while loop, no CPU would've been put into stopped state. Reinitialize the variable. This fixes commit d798e97456658ea7605303b7c69b04ec7df95c10 (Allow to use pause_all_vcpus from VCPU context) for non-KVM case. While at it, change a 0 to false, amending commit 4fdeee7cd4c8f90ef765537b9346a195d9483ab5 (cpu: Move stop field to CPUState). Reviewed-by: Jan Kiszka Signed-off-by: Andreas Färber --- cpus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index a2d92c7..c232265 100644 --- a/cpus.c +++ b/cpus.c @@ -974,9 +974,10 @@ void pause_all_vcpus(void) if (qemu_in_vcpu_thread()) { cpu_stop_current(); if (!kvm_enabled()) { + penv = first_cpu; while (penv) { CPUState *pcpu = ENV_GET_CPU(penv); - pcpu->stop = 0; + pcpu->stop = false; pcpu->stopped = true; penv = penv->next_cpu; }