Skip to content

Commit

Permalink
scsi-disk: fix reads from scsi-disk devices
Browse files Browse the repository at this point in the history
Commit fcaafb1 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>
  • Loading branch information
mcayland authored and pm215 committed Jun 6, 2016
1 parent 8625c3f commit 890e48d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/scsi/scsi-disk.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 890e48d

Please sign in to comment.