[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3] block/vdi: Use bdrv_flush after metadata updates

From: Zhe Qiu
Subject: [Qemu-devel] [PATCH v3] block/vdi: Use bdrv_flush after metadata updates
Date: Thu, 7 May 2015 12:04:56 +0800

From: phoeagon <address@hidden>

In reference to 
 metadata writes to qcow2/cow/qcow/vpc/vmdk are all synced prior to succeeding 

Only when write is successful that bdrv_flush is called.

Signed-off-by: Zhe Qiu <address@hidden>
 block/vdi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/vdi.c b/block/vdi.c
index 7642ef3..dfe8ade 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -713,6 +713,9 @@ static int vdi_co_write(BlockDriverState *bs,
         logout("will write %u block map sectors starting from entry %u\n",
                n_sectors, bmap_first);
         ret = bdrv_write(bs->file, offset, base, n_sectors);
+        if (ret >= 0) {
+            ret = bdrv_flush(bs->file);
+        }
     return ret;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]