From 1085819368e8693f08307e72f0082d759f67ef03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 2 May 2013 11:22:05 +0200 Subject: cpus: Fix pausing TCG CPUs while in vCPU thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) (limited to 'cpus.c') diff --git a/cpus.c b/cpus.c index a2d92c7a88..c232265cd2 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; } -- cgit v1.2.1