qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes()


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 3/6] qcow2: flush caches in qcow2_alloc_bytes()
Date: Tue, 19 Feb 2013 16:45:03 +0100

It is not completely clear to me what is being flushed in
qcow2_alloc_bytes() but bdrv_flush(bs->file) is probably wrong.  At
least the refcount cache should be flushed since this function calls
update_cluster_refcount().

To be on the safe side, call the full bdrv_flush(bs).  This flushes all
caches and the underlying file itself.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 block/qcow2-refcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 05b5ec9..4ef3dac 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -663,7 +663,7 @@ int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size)
         }
     }
 
-    bdrv_flush(bs->file);
+    bdrv_flush(bs);
     return offset;
 }
 
-- 
1.8.1.2




reply via email to

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