File kvm-qemu-preXX-kvm-Mark-VCPU-state-dirty-on-creation.patch of Package kvm.853

From d841b6c4f16c3fc7afe2ce355e7e42813345f053 Mon Sep 17 00:00:00 2001
From: Jan Kiszka <jan.kiszka@siemens.com>
Date: Tue, 15 Mar 2011 12:26:20 +0100
Subject: [PATCH] kvm: Mark VCPU state dirty on creation

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(-)

Index: qemu-kvm-0.14.0/kvm-all.c
===================================================================
--- qemu-kvm-0.14.0.orig/kvm-all.c
+++ qemu-kvm-0.14.0/kvm-all.c
@@ -224,6 +224,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) {