]> git.proxmox.com Git - qemu.git/commitdiff
do not issue ioctl from within the io thread
authorGlauber Costa <glommer@redhat.com>
Tue, 25 Aug 2009 22:13:36 +0000 (18:13 -0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 4 Sep 2009 14:37:27 +0000 (09:37 -0500)
According to Documentation/kvm/api.txt, (and well, to common sense),
we should not be calling vcpu ioctls from within the iothread.
Since vcpu initialization issues a vcpu ioctl, move it a little bit
further in time to prevent it.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl.c

diff --git a/vl.c b/vl.c
index 4f75d9b564cacc5f5e8084ff1d7166f051b4bcf8..dd5eebfe9ceb5245c019a4fa7d4e27dde6243d59 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3749,6 +3749,7 @@ static void *kvm_cpu_thread_fn(void *arg)
 
     block_io_signals();
     qemu_thread_self(env->thread);
+    kvm_init_vcpu(env);
 
     /* signal CPU creation */
     qemu_mutex_lock(&qemu_global_mutex);
@@ -3944,7 +3945,6 @@ static void tcg_init_vcpu(void *_env)
 
 static void kvm_start_vcpu(CPUState *env)
 {
-    kvm_init_vcpu(env);
     env->thread = qemu_mallocz(sizeof(QemuThread));
     env->halt_cond = qemu_mallocz(sizeof(QemuCond));
     qemu_cond_init(env->halt_cond);