aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-01-14 15:55:38 +0100
committerKevin Wolf <kwolf@redhat.com>2011-01-24 16:41:49 +0100
commit3de0a2944bdb3047dce275560631834bcb4afe22 (patch)
tree3549f925839388bae068f15ca148d5282ccd5beb /block/qcow2-cluster.c
parent29c1a7301af752de6721e031d31faa48887204bd (diff)
downloadqemu-3de0a2944bdb3047dce275560631834bcb4afe22.zip
qemu-3de0a2944bdb3047dce275560631834bcb4afe22.tar.gz
qemu-3de0a2944bdb3047dce275560631834bcb4afe22.tar.bz2
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 <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c2
1 files changed, 1 insertions, 1 deletions
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);