]> git.proxmox.com Git - mirror_qemu.git/commit
cpus: tcg: fix never exiting loop on unplug
authorCédric Le Goater <clg@kaod.org>
Wed, 25 Apr 2018 13:18:28 +0000 (15:18 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Jul 2018 16:48:21 +0000 (11:48 -0500)
commit54eb6cc6d7ad88ee634fc95a435dc5072f90c019
tree13b95514782f19177ee7959d4ca7cf0231bb24ac
parent9eb3e5a8a8cfd24f2b2b5eff447ff2a9c0629888
cpus: tcg: fix never exiting loop on unplug

Commit 9b0605f9837b ("cpus: tcg: unregister thread with RCU, fix
exiting of loop on unplug") changed the exit condition of the loop in
the vCPU thread function but forgot to remove the beginning 'while (1)'
statement. The resulting code :

while (1) {
...
} while (!cpu->unplug || cpu_can_run(cpu));

is a sequence of two distinct two while() loops, the first not exiting
in case of an unplug event.

Remove the first while (1) to fix CPU unplug.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20180425131828.15604-1-clg@kaod.org>
Cc: qemu-stable@nongnu.org
Fixes: 9b0605f9837b68fd56c7fc7c96a3a1a3b983687d
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
(cherry picked from commit 54961aac190df28d311802364d19e18d5cda8bab)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
cpus.c