When the vCPU thread finished its processing, destroy
it and signal its destruction to generic vCPU management
layer.
Add a sanity check for the vCPU accelerator context.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20230624174121.11508-6-philmd@linaro.org>
qemu_wait_io_event(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
+ hax_vcpu_destroy(cpu);
+ cpu_thread_signal_destroyed(cpu);
rcu_unregister_thread();
return NULL;
}
cpu->cpu_index);
qemu_thread_create(cpu->thread, thread_name, hax_cpu_thread_fn,
cpu, QEMU_THREAD_JOINABLE);
+ assert(cpu->hax_vcpu);
#ifdef _WIN32
cpu->hThread = qemu_thread_get_handle(cpu->thread);
#endif
CloseHandle(cpu->hThread);
#endif
g_free(vcpu);
+ cpu->hax_vcpu = NULL;
return 0;
}