Patchwork [24/35] kvm: Mark VCPU state dirty on creation

login
register
mail settings
Submitter Marcelo Tosatti
Date March 15, 2011, 9:50 p.m.
Message ID <4650d7eabfef39f471d7d791208917c4dc1b0d34.1300225848.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/87099/
State New
Headers show

Comments

Marcelo Tosatti - March 15, 2011, 9:50 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

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 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 226843c..62b0984 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) {