From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXqBr-0005Ry-9n for qemu-devel@nongnu.org; Thu, 02 May 2013 05:52:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXqBj-0000hh-8x for qemu-devel@nongnu.org; Thu, 02 May 2013 05:52:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37388 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXqBj-0000hE-31 for qemu-devel@nongnu.org; Thu, 02 May 2013 05:52:31 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 2 May 2013 11:52:20 +0200 Message-Id: <1367488340-14782-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu for-1.5] cpus: Fix pausing TCG CPUs while in vCPU thread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= , peter.maydell@linaro.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). Signed-off-by: Andreas F=C3=A4rber --- For 1.5 I'm going for the least invasive change here. On qom-cpu-10 I'm preparing to replace each CPU loop with qemu_for_each_= cpu(). 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 =3D first_cpu; while (penv) { CPUState *pcpu =3D ENV_GET_CPU(penv); - pcpu->stop =3D 0; + pcpu->stop =3D false; pcpu->stopped =3D true; penv =3D penv->next_cpu; } --=20 1.8.1.4