summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cpus.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index 740b8dc3f8..79f780b654 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1483,6 +1483,12 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
                 /* Ignore everything else? */
                 break;
             }
+        } else if (cpu->unplug) {
+            qemu_tcg_destroy_vcpu(cpu);
+            cpu->created = false;
+            qemu_cond_signal(&qemu_cpu_cond);
+            qemu_mutex_unlock_iothread();
+            return NULL;
         }
 
         atomic_mb_set(&cpu->exit_request, 0);