]> git.proxmox.com Git - mirror_qemu.git/commitdiff
kvm: Mark VCPU state dirty on creation
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 15 Mar 2011 11:26:20 +0000 (12:26 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 Mar 2011 20:11:05 +0000 (17:11 -0300)
This avoids that early cpu_synchronize_state calls try to retrieve an
uninitialized state from the kernel. That even causes a deadlock if
io-thread is enabled.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm-all.c

index 226843c65fe0908f1129da92c362670a98b901e5..62b098441dbb176dbba66ec5aecde2c2db7020cb 100644 (file)
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -211,6 +211,7 @@ int kvm_init_vcpu(CPUState *env)
 
     env->kvm_fd = ret;
     env->kvm_state = s;
+    env->kvm_vcpu_dirty = 1;
 
     mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0);
     if (mmap_size < 0) {