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>
This commit is contained in:
Glauber Costa authored and Anthony Liguori committed 2009-10-12 09:42:31 -05:00
1 parent ce88f890bd
commit d549db5a73
3 files changed
+9 -4

No files matched your search

+2
View File
@@ -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) {