Patchwork [v2,09/20] kvm: Mark VCPU state dirty on creation

login
register
mail settings
Submitter Jan Kiszka
Date March 15, 2011, 11:26 a.m.
Message ID <bd05262a8fd215cdb3fd096d75f404e0db14ec40.1300188374.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/86962/
State New
Headers show

Comments

Jan Kiszka - March 15, 2011, 11:26 a.m.
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>
---
 kvm-all.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 25ab545..36553fe 100644
--- 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) {