mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
Prevent abortion on multiple VCPU kicks
If we call qemu_cpu_kick more than once before the target was able to process the signal, pthread_kill will fail, and qemu will abort. Prevent this by avoiding the redundant signal. This logic can be found in qemu-kvm as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
8668f61d20
commit
aa2c364b4c
2 changed files with 6 additions and 1 deletions
6
cpus.c
6
cpus.c
|
@ -481,6 +481,7 @@ static void qemu_wait_io_event_common(CPUState *env)
|
|||
qemu_cond_signal(&qemu_pause_cond);
|
||||
}
|
||||
flush_queued_work(env);
|
||||
env->thread_kicked = false;
|
||||
}
|
||||
|
||||
static void qemu_tcg_wait_io_event(void)
|
||||
|
@ -648,7 +649,10 @@ void qemu_cpu_kick(void *_env)
|
|||
{
|
||||
CPUState *env = _env;
|
||||
qemu_cond_broadcast(env->halt_cond);
|
||||
qemu_thread_signal(env->thread, SIG_IPI);
|
||||
if (!env->thread_kicked) {
|
||||
qemu_thread_signal(env->thread, SIG_IPI);
|
||||
env->thread_kicked = true;
|
||||
}
|
||||
}
|
||||
|
||||
int qemu_cpu_self(void *_env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue