]> git.proxmox.com Git - mirror_qemu.git/commit - hw/block/virtio-blk.c
block: introduce BDRV_REQUEST_MAX_SECTORS
authorPeter Lieven <pl@kamp.de>
Fri, 6 Feb 2015 10:54:11 +0000 (11:54 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Feb 2015 16:24:22 +0000 (17:24 +0100)
commit75af1f34cd5b07c3c7fcf86dfc99a42de48a600d
tree701e882e64c3023a6e6b9fbd1a9547e5f2d8c5f9
parent1ce52846d3ce0e4b58caebcae84719bef6401fbb
block: introduce BDRV_REQUEST_MAX_SECTORS

we check and adjust request sizes at several places with
sometimes inconsistent checks or default values:
 INT_MAX
 INT_MAX >> BDRV_SECTOR_BITS
 UINT_MAX >> BDRV_SECTOR_BITS
 SIZE_MAX >> BDRV_SECTOR_BITS

This patches introdocues a macro for the maximal allowed sectors
per request and uses it at several places.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
hw/block/virtio-blk.c
include/block/block.h