diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2015-10-19 10:38:38 -0400 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-10-21 11:53:28 -0400 |
commit | 3a90da6305e2741e0da7b89bb16deed038458aee (patch) | |
tree | 56800bb209d52facaedc3fc80e6df3a3797fe429 | |
parent | 49764dc072f1a9bb9955bfa3643e8c62580220d6 (diff) | |
download | kvmtool-3a90da6305e2741e0da7b89bb16deed038458aee.tar.gz |
kvmtool: assume dead vcpus are paused too
vcpus that have exited their main loop can be treated as paused too when we're
trying to pause the machine to change mappings.
This might happen during shutdown when we're trying to unmap ioports but some
of the vcpus already exited.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | kvm.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -442,7 +442,10 @@ void kvm__pause(struct kvm *kvm) if (pause_event < 0) die("Failed creating pause notification event"); for (i = 0; i < kvm->nrcpus; i++) - pthread_kill(kvm->cpus[i]->thread, SIGKVMPAUSE); + if (kvm->cpus[i]->is_running) + pthread_kill(kvm->cpus[i]->thread, SIGKVMPAUSE); + else + paused_vcpus++; while (paused_vcpus < kvm->nrcpus) { u64 cur_read; |