Patchwork [v3,2/7] savevm: flush after saving vm state

login
register
mail settings
Submitter Paolo Bonzini
Date June 5, 2012, 10:04 p.m.
Message ID <1338933895-20677-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/163182/
State New
Headers show

Comments

Paolo Bonzini - June 5, 2012, 10:04 p.m.
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 <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 savevm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

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)