* Re: [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices
2016-06-03 5:17 [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices Mark Cave-Ayland
@ 2016-06-03 6:10 ` xiaoqiang zhao
2016-06-03 12:42 ` Eric Blake
2016-06-07 1:44 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 5+ messages in thread
From: xiaoqiang zhao @ 2016-06-03 6:10 UTC (permalink / raw)
To: Mark Cave-Ayland, qemu-devel, qemu-block, pbonzini
在 2016年06月03日 13:17, Mark Cave-Ayland 写道:
> 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>
> ---
> hw/scsi/scsi-disk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index ace65e0..ab7cf9c 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);
> }
>
This patch fix the qemu-system-arm booting issue.
Tested-by: xiaoqiang zhao <zxq_yx_007@163.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices
2016-06-03 5:17 [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices Mark Cave-Ayland
2016-06-03 6:10 ` xiaoqiang zhao
@ 2016-06-03 12:42 ` Eric Blake
2016-06-06 12:58 ` Peter Maydell
2016-06-07 1:44 ` Benjamin Herrenschmidt
2 siblings, 1 reply; 5+ messages in thread
From: Eric Blake @ 2016-06-03 12:42 UTC (permalink / raw)
To: Mark Cave-Ayland, qemu-devel, qemu-block, pbonzini, zxq_yx_007
[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]
On 06/02/2016 11:17 PM, Mark Cave-Ayland wrote:
> 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>
> ---
> hw/scsi/scsi-disk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index ace65e0..ab7cf9c 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);
> }
>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices
2016-06-03 12:42 ` Eric Blake
@ 2016-06-06 12:58 ` Peter Maydell
0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2016-06-06 12:58 UTC (permalink / raw)
To: Eric Blake
Cc: Mark Cave-Ayland, QEMU Developers, Qemu-block, Paolo Bonzini,
xiaoqiang zhao
On 3 June 2016 at 13:42, Eric Blake <eblake@redhat.com> wrote:
> On 06/02/2016 11:17 PM, Mark Cave-Ayland wrote:
>> 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>
>> ---
>> hw/scsi/scsi-disk.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
Thanks. Applied to master, since it's awkward to leave scsi disks broken...
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices
2016-06-03 5:17 [Qemu-devel] [PATCH] scsi-disk: fix reads from scsi-disk devices Mark Cave-Ayland
2016-06-03 6:10 ` xiaoqiang zhao
2016-06-03 12:42 ` Eric Blake
@ 2016-06-07 1:44 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2016-06-07 1:44 UTC (permalink / raw)
To: Mark Cave-Ayland, qemu-devel, qemu-block, pbonzini, zxq_yx_007
On Fri, 2016-06-03 at 06:17 +0100, Mark Cave-Ayland wrote:
> 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>
This fixes powerpc PAPR booting
Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> hw/scsi/scsi-disk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index ace65e0..ab7cf9c 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);
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread