aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2015-05-12 17:30:55 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2015-05-22 09:37:33 +0100
commit4196d2f0308cb1ae13ed450424ab7dfe154acda9 (patch)
tree144b613251246975ae7dd0033cd53a509a837c56 /include
parenteaf5fe2dd4ec001d645ff3b343f466457badaa64 (diff)
downloadqemu-4196d2f0308cb1ae13ed450424ab7dfe154acda9.zip
qemu-4196d2f0308cb1ae13ed450424ab7dfe154acda9.tar.gz
qemu-4196d2f0308cb1ae13ed450424ab7dfe154acda9.tar.bz2
block: minimal bounce buffer alignment
The patch introduces new concept: minimal memory alignment for bounce buffers. Original so called "optimal" value is actually minimal required value for aligment. It should be used for validation that the IOVec is properly aligned and bounce buffer is not required. Though, from the performance point of view, it would be better if bounce buffer or IOVec allocated by QEMU will be aligned stricter. The patch does not change any alignment value yet. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1431441056-26198-2-git-send-email-den@openvz.org CC: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/block.h2
-rw-r--r--include/block/block_int.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 7d1a717..c1c963e 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -440,6 +440,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
/* Returns the alignment in bytes that is required so that no bounce buffer
* is required throughout the stack */
+size_t bdrv_min_mem_align(BlockDriverState *bs);
+/* Returns optimal alignment in bytes for bounce buffer */
size_t bdrv_opt_mem_align(BlockDriverState *bs);
void bdrv_set_guest_block_size(BlockDriverState *bs, int align);
void *qemu_blockalign(BlockDriverState *bs, size_t size);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index db29b74..f004378 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -313,6 +313,9 @@ typedef struct BlockLimits {
int max_transfer_length;
/* memory alignment so that no bounce buffer is needed */
+ size_t min_mem_alignment;
+
+ /* memory alignment for bounce buffer */
size_t opt_mem_alignment;
} BlockLimits;