aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpus.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index 4a10775cb6..17b055fba0 100644
--- a/cpus.c
+++ b/cpus.c
@@ -875,6 +875,18 @@ void pause_all_vcpus(void)
penv = penv->next_cpu;
}
+ if (!qemu_thread_is_self(&io_thread)) {
+ cpu_stop_current();
+ if (!kvm_enabled()) {
+ while (penv) {
+ penv->stop = 0;
+ penv->stopped = 1;
+ penv = penv->next_cpu;
+ }
+ return;
+ }
+ }
+
while (!all_vcpus_paused()) {
qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex);
penv = first_cpu;