[Top][All Lists]

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

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

From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v3] block/vdi: Use bdrv_flush after metadata updates
Date: Fri, 08 May 2015 15:10:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 07.05.2015 06:04, Zhe Qiu wrote:
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(+)

Reviewed-by: Max Reitz <address@hidden>


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]