From patchwork Tue Jun 5 22:04:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3,2/7] savevm: flush after saving vm state X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 163182 Message-Id: <1338933895-20677-3-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Date: Wed, 6 Jun 2012 00:04:50 +0200 From: Paolo Bonzini List-Id: Writing vm state uses bdrv_pwrite, so it will automatically get flushes in writethrough mode. But doing a flush at the end in writeback mode is probably a good idea anyway. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/savevm.c b/savevm.c index 2d18bab..2b6833d 100644 --- a/savevm.c +++ b/savevm.c @@ -400,7 +400,7 @@ static int block_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size) static int bdrv_fclose(void *opaque) { - return 0; + return bdrv_flush(opaque); } static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int is_writable)