aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2015-10-19 10:38:38 -0400
committerSasha Levin <sasha.levin@oracle.com>2015-10-21 11:53:28 -0400
commit3a90da6305e2741e0da7b89bb16deed038458aee (patch)
tree56800bb209d52facaedc3fc80e6df3a3797fe429
parent49764dc072f1a9bb9955bfa3643e8c62580220d6 (diff)
downloadkvmtool-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kvm.c b/kvm.c
index 10ed2300..07d4cc3f 100644
--- a/kvm.c
+++ b/kvm.c
@@ -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;