aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-snapshot.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-09-17 16:57:48 +0200
committerKevin Wolf <kwolf@redhat.com>2010-09-21 15:39:42 +0200
commit29216ed14f0bae35d1d9bb114a1aee7ee6837670 (patch)
tree0efa159973f58e73a1ee93c200783b1a94d7d465 /block/qcow2-snapshot.c
parent1c4c28149fff77b8c983fdabe4e76bdc8cadd572 (diff)
downloadqemu-29216ed14f0bae35d1d9bb114a1aee7ee6837670.zip
qemu-29216ed14f0bae35d1d9bb114a1aee7ee6837670.tar.gz
qemu-29216ed14f0bae35d1d9bb114a1aee7ee6837670.tar.bz2
qcow2: Move sync out of qcow2_alloc_clusters
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-snapshot.c')
-rw-r--r--block/qcow2-snapshot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 6228612..bbfcaaa 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -138,6 +138,7 @@ static int qcow_write_snapshots(BlockDriverState *bs)
snapshots_size = offset;
snapshots_offset = qcow2_alloc_clusters(bs, snapshots_size);
+ bdrv_flush(bs->file);
offset = snapshots_offset;
if (offset < 0) {
return offset;
@@ -271,6 +272,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
if (l1_table_offset < 0) {
goto fail;
}
+ bdrv_flush(bs->file);
sn->l1_table_offset = l1_table_offset;
sn->l1_size = s->l1_size;