block: Give nonzero result to blk_get_max_transfer_length()
authorEric Blake <eblake@redhat.com>
Thu, 23 Jun 2016 22:37:12 +0000 (16:37 -0600)
committerKevin Wolf <kwolf@redhat.com>
Tue, 5 Jul 2016 14:46:25 +0000 (16:46 +0200)
commit24ce9a20260713e86377cfa78fb8699335759f4f
tree9896792aec32b6b6153778828641071f8e1c238d
parentefaf4781a995aacd22b1dd521b14e4644bafae14
block: Give nonzero result to blk_get_max_transfer_length()

Making all callers special-case 0 as unlimited is awkward,
and we DO have a hard maximum of BDRV_REQUEST_MAX_SECTORS given
our current block layer API limits.

In the case of scsi, this means that we now always advertise a
limit to the guest, even in cases where the underlying layers
previously use 0 for no inherent limit beyond the block layer.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c
hw/block/virtio-blk.c
hw/scsi/scsi-generic.c