Message ID | 20220323171751.78612-9-philippe.mathieu.daude@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | accel: Fix vCPU memory leaks | expand |
diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index de8af32af7..3da684b8e6 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -272,6 +272,13 @@ static void *rr_cpu_thread_fn(void *arg) return NULL; } +static QemuThread *single_tcg_cpu_thread; + +bool rr_create_vcpu_thread_precheck(CPUState *cpu) +{ + return !single_tcg_cpu_thread; +} + void rr_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; diff --git a/accel/tcg/tcg-accel-ops-rr.h b/accel/tcg/tcg-accel-ops-rr.h index 54f6ae6e86..e2273b66d4 100644 --- a/accel/tcg/tcg-accel-ops-rr.h +++ b/accel/tcg/tcg-accel-ops-rr.h @@ -15,6 +15,7 @@ /* Kick all RR vCPUs. */ void rr_kick_vcpu_thread(CPUState *unused); +bool rr_create_vcpu_thread_precheck(CPUState *cpu); /* start the round robin vcpu thread */ void rr_start_vcpu_thread(CPUState *cpu);