From 29216ed14f0bae35d1d9bb114a1aee7ee6837670 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 17 Sep 2010 16:57:48 +0200 Subject: qcow2: Move sync out of qcow2_alloc_clusters Signed-off-by: Kevin Wolf --- block/qcow2-snapshot.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/qcow2-snapshot.c') diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 6228612f84..bbfcaaae22 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; -- cgit v1.2.3