aboutsummaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-01-21 21:48:19 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-01-23 02:27:22 -0200
commitb0c883b5e079a4f719c43f875034e5e665ccc232 (patch)
treee7d2744d7a64748b0a7ba7cc032c411432ae1a6d /kvm-all.c
parent110761987d10c6e6983cc445618acfd158d7ce02 (diff)
kvm: Flush coalesced mmio buffer on IO window exits
We must flush pending mmio writes if we leave kvm_cpu_exec for an IO window. Otherwise we risk to loose those requests when migrating to a different host during that window. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 3a1f63b5b1..9976762f87 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -918,6 +918,8 @@ int kvm_cpu_exec(CPUState *env)
cpu_single_env = env;
kvm_arch_post_run(env, run);
+ kvm_flush_coalesced_mmio_buffer();
+
if (ret == -EINTR || ret == -EAGAIN) {
cpu_exit(env);
DPRINTF("io window exit\n");
@@ -930,8 +932,6 @@ int kvm_cpu_exec(CPUState *env)
abort();
}
- kvm_flush_coalesced_mmio_buffer();
-
ret = 0; /* exit loop */
switch (run->exit_reason) {
case KVM_EXIT_IO: