qemu-e2k/include/block
Kevin Wolf 339064d506 block: Don't use guest sector size for qemu_blockalign()
bs->buffer_alignment is set by the device emulation and contains the
logical block size of the guest device. This isn't something that the
block layer should know, and even less something to use for determining
the right alignment of buffers to be used for the host.

The new BlockLimits field opt_mem_alignment tells the qemu block layer
the optimal alignment to be used so that no bounce buffer must be used
in the driver.

This patch may change the buffer alignment from 4k to 512 for all
callers that used qemu_blockalign() with the top-level image format
BlockDriverState. The value was never propagated to other levels in the
tree, so in particular raw-posix never required anything else than 512.

While on disks with 4k sectors direct I/O requires a 4k alignment,
memory may still be okay when aligned to 512 byte boundaries. This is
what must have happened in practice, because otherwise this would
already have failed earlier. Therefore I don't expect regressions even
with this intermediate state. Later, raw-posix can implement the hook
and expose a different memory alignment requirement.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-01-24 17:40:01 +01:00
..
aio.h aio / timers: Add aio_timer_init & aio_timer_new wrappers 2013-08-22 19:10:28 +02:00
block.h block: Don't use guest sector size for qemu_blockalign() 2014-01-24 17:40:01 +01:00
block_int.h block: Don't use guest sector size for qemu_blockalign() 2014-01-24 17:40:01 +01:00
blockjob.h qapi: make use of new BlockJobType 2013-10-11 10:52:54 +02:00
coroutine.h coroutine: remove unused CoQueue AioContext 2013-12-02 17:11:49 +01:00
coroutine_int.h coroutine: stop using AioContext in CoQueue 2013-05-24 16:17:56 +02:00
nbd.h nbd: support large NBD requests 2013-05-03 13:05:49 +02:00
qapi.h qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes. 2014-01-24 16:07:08 +01:00
scsi.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
snapshot.h qemu-nbd: support internal snapshot export 2013-12-04 15:19:00 +01:00
thread-pool.h threadpool: drop global thread pool 2013-03-15 16:07:51 +01:00