aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2016-06-03 06:17:01 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-06 13:23:41 +0100
commit890e48d7fc7d2ba490610b7ccaa3f479b5f3c1b1 (patch)
tree61fa7381c812e173442e2d54ed3eb146237497a8 /hw
parent8625c3ffc883e8b5bcac345fa7ac5e9fec6fb593 (diff)
scsi-disk: fix reads from scsi-disk devices
Commit fcaafb1001b9c42817714dd3b2aadcfdb997b53d accidentally broke reads from scsi-disk devices when being updated from its original form to use the new byte-based block functions. Add the extra missing sector to offset conversion in order to restore read functionality. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: xiaoqiang zhao <zxq_yx_007@163.com> Message-id: 1464931021-25117-1-git-send-email-mark.cave-ayland@ilande.co.uk Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/scsi-disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index ace65e0720..ab7cf9cbf8 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -347,7 +347,7 @@ static void scsi_do_read(SCSIDiskReq *r, int ret)
scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct,
r->qiov.size, BLOCK_ACCT_READ);
- r->req.aiocb = sdc->dma_readv(r->sector, &r->qiov,
+ r->req.aiocb = sdc->dma_readv(r->sector << BDRV_SECTOR_BITS, &r->qiov,
scsi_read_complete, r, r);
}