summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-09-09 17:53:37 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:18:06 -0500
commit40b4f539678266160badd5ac4afa9833f9089154 (patch)
treec54e3455975d74e8fefdfd349c9b7a854922abbf /block_int.h
parentRevert "don't call cpu_sychronize_state from reset handlers" (diff)
downloadqemu-kvm-40b4f539678266160badd5ac4afa9833f9089154.tar.gz
qemu-kvm-40b4f539678266160badd5ac4afa9833f9089154.tar.bz2
qemu-kvm-40b4f539678266160badd5ac4afa9833f9089154.zip
Add bdrv_aio_multiwrite
One performance problem of qcow2 during the initial image growth are sequential writes that are not cluster aligned. In this case, when a first requests requires to allocate a new cluster but writes only to the first couple of sectors in that cluster, the rest of the cluster is zeroed - just to be overwritten by the following second request that fills up the cluster. Let's try to merge sequential write requests to the same cluster, so we can avoid to write the zero padding to the disk in the first place. As a nice side effect, also other formats take advantage of dealing with less and larger requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block_int.h')
-rw-r--r--block_int.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h
index 0902fd473..3e4b4a387 100644
--- a/block_int.h
+++ b/block_int.h
@@ -70,6 +70,12 @@ struct BlockDriver {
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
+ int (*bdrv_aio_multiwrite)(BlockDriverState *bs, BlockRequest *reqs,
+ int num_reqs);
+ int (*bdrv_merge_requests)(BlockDriverState *bs, BlockRequest* a,
+ BlockRequest *b);
+
+
const char *protocol_name;
int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset);
int64_t (*bdrv_getlength)(BlockDriverState *bs);