summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-11-10 18:10:11 +0100
committerKevin Wolf <kwolf@redhat.com>2011-11-11 14:02:59 +0100
commiteb489bb1eceea0d710cd5f5122d37213300ceef6 (patch)
treea4f6ea0374bdd83c83ebe7391c56211c7190ed71 /block
parentc68b89acd636ff545bc7cb92739c41999291ce3c (diff)
downloadqemu-eb489bb1eceea0d710cd5f5122d37213300ceef6.tar.gz
block: Introduce bdrv_co_flush_to_os
qcow2 has a writeback metadata cache, so flushing a qcow2 image actually consists of writing back that cache to the protocol and only then flushes the protocol in order to get everything stable on disk. This introduces a separate bdrv_co_flush_to_os to reflect the split. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index f7f73fe376..5c784eee51 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1105,7 +1105,7 @@ fail:
return ret;
}
-static int qcow2_co_flush(BlockDriverState *bs)
+static int qcow2_co_flush_to_os(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
int ret;
@@ -1124,6 +1124,11 @@ static int qcow2_co_flush(BlockDriverState *bs)
}
qemu_co_mutex_unlock(&s->lock);
+ return 0;
+}
+
+static int qcow2_co_flush_to_disk(BlockDriverState *bs)
+{
return bdrv_co_flush(bs->file);
}
@@ -1245,7 +1250,8 @@ static BlockDriver bdrv_qcow2 = {
.bdrv_co_readv = qcow2_co_readv,
.bdrv_co_writev = qcow2_co_writev,
- .bdrv_co_flush_to_disk = qcow2_co_flush,
+ .bdrv_co_flush_to_os = qcow2_co_flush_to_os,
+ .bdrv_co_flush_to_disk = qcow2_co_flush_to_disk,
.bdrv_co_discard = qcow2_co_discard,
.bdrv_truncate = qcow2_truncate,