From patchwork Wed Nov 24 15:52:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCHv2,2/6] cpus: flush all requests on each vm stop From: "Michael S. Tsirkin" X-Patchwork-Id: 72915 Message-Id: <732b3c1a27c2d274989328218bb5e831b28686dd.1290613959.git.mst@redhat.com> To: jasowang@redhat.com, Anthony Liguori , qemu-devel@nongnu.org, quintela@redhat.com Cc: Date: Wed, 24 Nov 2010 17:52:58 +0200 Make sure disk is in consistent state. Signed-off-by: Michael S. Tsirkin Tested-by: Jason Wang --- cpus.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index 91a0fb1..d421a96 100644 --- a/cpus.c +++ b/cpus.c @@ -110,6 +110,8 @@ static void do_vm_stop(int reason) cpu_disable_ticks(); vm_running = 0; pause_all_vcpus(); + qemu_aio_flush(); + bdrv_flush_all(); vm_state_notify(0, reason); monitor_protocol_event(QEVENT_STOP, NULL); }