summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-09-06 18:58:56 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-12 15:17:22 +0200
commit668499f2894c9eb4784263ea753406083cc5f313 (patch)
treee324791fd740f92f06157f028958d207c52adf45 /block.c
parentd0bf303e6c98eb7215af083bfda5f33de0108f9e (diff)
downloadqemu-668499f2894c9eb4784263ea753406083cc5f313.tar.gz
qemu-668499f2894c9eb4784263ea753406083cc5f313.tar.bz2
qemu-668499f2894c9eb4784263ea753406083cc5f313.zip
block: New bdrv_set_buffer_alignment()
Device models should be able to set it without an unclean include of block_int.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block.c b/block.c
index febfd671e5..e9869863d1 100644
--- a/block.c
+++ b/block.c
@@ -480,7 +480,6 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename,
bs->encrypted = 0;
bs->valid_key = 0;
bs->open_flags = flags;
- /* buffer_alignment defaulted to 512, drivers can change this value */
bs->buffer_alignment = 512;
pstrcpy(bs->filename, sizeof(bs->filename), filename);
@@ -3115,7 +3114,10 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
return NULL;
}
-
+void bdrv_set_buffer_alignment(BlockDriverState *bs, int align)
+{
+ bs->buffer_alignment = align;
+}
void *qemu_blockalign(BlockDriverState *bs, size_t size)
{