summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-10-07 16:38:03 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-12 09:42:31 -0500
commitd549db5a732ef2ec145b84c5008a7585cf17cf67 (patch)
tree62fa1660dca3ce393c20c92be0469408d4e46204 /kvm-all.c
parentTARGET_I386 is always defined if TARGET_X86_64 is defined (diff)
downloadqemu-kvm-d549db5a732ef2ec145b84c5008a7585cf17cf67.tar.gz
qemu-kvm-d549db5a732ef2ec145b84c5008a7585cf17cf67.tar.bz2
qemu-kvm-d549db5a732ef2ec145b84c5008a7585cf17cf67.zip
unlock iothread mutex before running kvm ioctl
Without this, kvm will hold the mutex while it issues its run ioctl, and never be able to step out of it, causing a deadlock. Patchworks-ID: 35359 Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 5ea0dd8b1..48ae26cae 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -605,7 +605,9 @@ int kvm_cpu_exec(CPUState *env)
}
kvm_arch_pre_run(env, run);
+ qemu_mutex_unlock_iothread();
ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
+ qemu_mutex_lock_iothread();
kvm_arch_post_run(env, run);
if (ret == -EINTR || ret == -EAGAIN) {