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 789ff7897b..34c86192d1 100644 --- a/cpus.c +++ b/cpus.c @@ -1235,7 +1235,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; @@ -1247,8 +1247,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 } -- 2.14.3