Commit 10858193 authored by Andreas Färber's avatar Andreas Färber
Browse files

cpus: Fix pausing TCG CPUs while in vCPU thread



Due to a preceding while loop, no CPU would've been put into stopped
state. Reinitialize the variable.
This fixes commit d798e974 (Allow to use
pause_all_vcpus from VCPU context) for non-KVM case.

While at it, change a 0 to false, amending commit
4fdeee7c (cpu: Move stop field to
CPUState).

Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
parent 0514ef2f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
            }