Add destroy_vcpu_thread() to AccelOps as a method for vcpu thread cleanup. This will be used in subsequent patches.
Suggested-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Mark Kanda <mark.ka...@oracle.com> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- include/sysemu/accel-ops.h | 1 + softmmu/cpus.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 6013c9444c..e296b27b82 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -31,6 +31,7 @@ struct AccelOpsClass { bool (*cpus_are_resettable)(void); void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ + void (*destroy_vcpu_thread)(CPUState *cpu); void (*kick_vcpu_thread)(CPUState *cpu); bool (*cpu_thread_is_idle)(CPUState *cpu); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 7b75bb66d5..622f8b4608 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -609,6 +609,9 @@ void cpu_remove_sync(CPUState *cpu) qemu_mutex_unlock_iothread(); qemu_thread_join(cpu->thread); qemu_mutex_lock_iothread(); + if (cpus_accel->destroy_vcpu_thread) { + cpus_accel->destroy_vcpu_thread(cpu); + } } void cpus_register_accel(const AccelOpsClass *ops) -- 2.27.0