Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- cpus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cpus.c b/cpus.c index 1063dac..190ad5a 100644 --- a/cpus.c +++ b/cpus.c @@ -1234,7 +1234,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) cpu->created = true; qemu_cond_signal(&qemu_cpu_cond); - while (1) { + do { qemu_mutex_unlock_iothread(); do { int sig; @@ -1246,8 +1246,9 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) } qemu_mutex_lock_iothread(); qemu_wait_io_event(cpu); - } + } while (!cpu->unplug); + rcu_unregister_thread(); return NULL; #endif } -- 1.8.3.1