qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/6] qcow2: flush refcount cache correctly in alloc_


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 1/6] qcow2: flush refcount cache correctly in alloc_refcount_block()
Date: Tue, 19 Feb 2013 16:45:01 +0100

update_refcount() affects the refcount cache, it does not write to disk.
Therefore bdrv_flush(bs->file) does nothing.  We need to flush the
refcount cache in order to write out the refcount updates!

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 bc1784c..05b5ec9 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -237,7 +237,7 @@ static int alloc_refcount_block(BlockDriverState *bs,
             goto fail_block;
         }
 
-        bdrv_flush(bs->file);
+        qcow2_cache_flush(bs, s->refcount_block_cache);
 
         /* Initialize the new refcount block only after updating its refcount,
          * update_refcount uses the refcount cache itself */
-- 
1.8.1.2




reply via email to

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