[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/20] qcow2: Move sync out of qcow2_alloc_clusters
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 10/20] qcow2: Move sync out of qcow2_alloc_clusters |
Date: |
Tue, 21 Sep 2010 17:21:52 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-cluster.c | 3 +++
block/qcow2-refcount.c | 4 ++--
block/qcow2-snapshot.c | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index f562b16..818c0db 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -60,6 +60,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, int min_size)
qemu_free(new_l1_table);
return new_l1_table_offset;
}
+ bdrv_flush(bs->file);
BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_WRITE_TABLE);
for(i = 0; i < s->l1_size; i++)
@@ -243,6 +244,7 @@ static int l2_allocate(BlockDriverState *bs, int l1_index,
uint64_t **table)
if (l2_offset < 0) {
return l2_offset;
}
+ bdrv_flush(bs->file);
/* allocate a new entry in the l2 cache */
@@ -863,6 +865,7 @@ int qcow2_alloc_cluster_offset(BlockDriverState *bs,
uint64_t offset,
QLIST_REMOVE(m, next_in_flight);
return cluster_offset;
}
+ bdrv_flush(bs->file);
/* save info needed for meta data update */
m->offset = offset;
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 4fc3f80..7082601 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -629,8 +629,6 @@ int64_t qcow2_alloc_clusters(BlockDriverState *bs, int64_t
size)
return ret;
}
- bdrv_flush(bs->file);
-
return offset;
}
@@ -678,6 +676,8 @@ int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size)
goto redo;
}
}
+
+ bdrv_flush(bs->file);
return offset;
}
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;
--
1.7.2.2
- [Qemu-devel] [PULL 00/20] Block patches, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 03/20] vvfat: Use cache=unsafe, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 01/20] vvfat: Fix segfault on write to read-only disk, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 02/20] vvfat: Fix double free for opening the image rw, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 05/20] raw-posix: handle > 512 byte alignment correctly, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 10/20] qcow2: Move sync out of qcow2_alloc_clusters,
Kevin Wolf <=
- [Qemu-devel] [PATCH 04/20] use qemu_blockalign consistently, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 11/20] qcow2: Get rid of additional sync on COW, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 13/20] scsi-disk: propagate the required alignment, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 07/20] nbd: correctly manage default port, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 08/20] qcow2: Move sync out of write_refcount_block_entries, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 16/20] qcow2: Avoid bounce buffers for AIO read requests, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 14/20] ide: propagate the required alignment, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 15/20] cutils: qemu_iovec_copy and qemu_iovec_memset, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 12/20] virtio-blk: propagate the required alignment, Kevin Wolf, 2010/09/21
- [Qemu-devel] [PATCH 09/20] qcow2: Move sync out of update_refcount, Kevin Wolf, 2010/09/21