From 3de0a2944bdb3047dce275560631834bcb4afe22 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 14 Jan 2011 15:55:38 +0100 Subject: qcow2: Batch flushes for COW qcow2 calls bdrv_flush() after performing COW in order to ensure that the L2 table change is never written before the copy is safe on disk. Now that the L2 table is cached, we can wait with flushing until we write out the next L2 table. Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/qcow2-cluster.c') diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 76e7e07..1c2003a 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -637,7 +637,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) * handled. */ if (cow) { - bdrv_flush(bs->file); + qcow2_cache_depends_on_flush(s->l2_table_cache); } qcow2_cache_set_dependency(bs, s->l2_table_cache, s->refcount_block_cache); -- cgit v1.1