kvmtool: don't unpause vm when exiting vcpu threads
Unconditionally resuming a vm is wrong here, it may not even be paused to
begin with.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
diff --git a/kvm-cpu.c b/kvm-cpu.c
index ad4441b..b56fd3b 100644
--- a/kvm-cpu.c
+++ b/kvm-cpu.c
@@ -44,14 +44,11 @@
static void kvm_cpu_signal_handler(int signum)
{
- if (signum == SIGKVMEXIT) {
- if (current_kvm_cpu && current_kvm_cpu->is_running) {
+ if (signum == SIGKVMEXIT)
+ if (current_kvm_cpu && current_kvm_cpu->is_running)
current_kvm_cpu->is_running = false;
- kvm__continue(current_kvm_cpu->kvm);
- }
- } else if (signum == SIGKVMPAUSE) {
+ else if (signum == SIGKVMPAUSE)
current_kvm_cpu->paused = 1;
- }
}
static void kvm_cpu__handle_coalesced_mmio(struct kvm_cpu *cpu)