[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 08/43] scsi: Advertise limits by blocksize, not 512
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 08/43] scsi: Advertise limits by blocksize, not 512 |
Date: |
Tue, 5 Jul 2016 17:50:17 +0200 |
From: Eric Blake <address@hidden>
s->blocksize may be larger than 512, in which case our
tweaks to max_xfer_len and opt_xfer_len must be scaled
appropriately.
CC: address@hidden
Reported-by: Fam Zheng <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/scsi/scsi-generic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 6a2d89a..75e227d 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -225,7 +225,8 @@ static void scsi_read_complete(void * opaque, int ret)
if (s->type == TYPE_DISK &&
r->req.cmd.buf[0] == INQUIRY &&
r->req.cmd.buf[2] == 0xb0) {
- uint32_t max_xfer_len = blk_get_max_transfer_length(s->conf.blk);
+ uint32_t max_xfer_len = blk_get_max_transfer_length(s->conf.blk) /
+ (s->blocksize / BDRV_SECTOR_SIZE);
if (max_xfer_len) {
stl_be_p(&r->buf[8], max_xfer_len);
/* Also take care of the opt xfer len. */
--
1.8.3.1
- [Qemu-block] [PULL 00/43] Block layer patches, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 01/43] qemu-img: fix failed autotests, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 03/43] block: Document supported flags during bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 04/43] block: Fix harmless off-by-one in bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 05/43] nbd: Allow larger requests, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 07/43] iscsi: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 02/43] block: Tighter assertions on bdrv_aligned_pwritev(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 08/43] scsi: Advertise limits by blocksize, not 512,
Kevin Wolf <=
- [Qemu-block] [PULL 06/43] nbd: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 09/43] block: Give nonzero result to blk_get_max_transfer_length(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 11/43] iscsi: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 10/43] blkdebug: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 12/43] qcow2: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 13/43] raw-win32: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 16/43] block: Switch transfer length bounds to byte-based, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 14/43] block: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 17/43] block: Wording tweaks to write zeroes limits, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 15/43] block: Set default request_alignment during bdrv_refresh_limits(), Kevin Wolf, 2016/07/05