aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-11-22 19:52:22 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-12-09 12:47:19 +0200
commit55df6f33655ed4139c824aa3ab9a4ab0c19dca83 (patch)
treec80493c289b8c11200d94f79e9470f99dd6bf40b /cpus.c
parent3a75e74c76cef8daa7944159b016c4ee7c56e568 (diff)
cpus: flush all requests on each vm stop
Flush all requests once we have stopped all cpus and devices. Make sure disk is in consistent state. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Jason Wang <jasowang@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index 91a0fb1146..0309189bfd 100644
--- a/cpus.c
+++ b/cpus.c
@@ -111,6 +111,8 @@ static void do_vm_stop(int reason)
vm_running = 0;
pause_all_vcpus();
vm_state_notify(0, reason);
+ qemu_aio_flush();
+ bdrv_flush_all();
monitor_protocol_event(QEVENT_STOP, NULL);
}
}