Re: [PATCH] virtio_scsi: Always try to read VPD pages
From: Stefan Hajnoczi
Date: Thu Apr 13 2017 - 09:39:26 EST
On Thu, Apr 13, 2017 at 12:13:00PM +1000, David Gibson wrote:
> @@ -705,6 +706,28 @@ static int virtscsi_device_reset(struct scsi_cmnd *sc)
> return virtscsi_tmf(vscsi, cmd);
> }
>
> +static int virtscsi_device_alloc(struct scsi_device *sdevice)
> +{
> + /*
> + * Passed through SCSI targets (e.g. with qemu's 'scsi-block')
> + * may have transfer limits which come from the host SCSI
> + * controller something on the host side other than the target
s/controller something/controller or something/ ?
> + * itself.
> + *
> + * To make this work properly, the hypervisor can adjust the
> + * target's VPD information to advertise these limits. But
> + * for that to work, the guest has to look at the VPD pages,
> + * which we won't do by default if it is an SPC-2 device, even
> + * if it does actually support it.
> + *
> + * So, set the blist to always try to read the VPD pages.
> + */
> + sdevice->sdev_bflags = BLIST_TRY_VPD_PAGES;
> +
> + return 0;
> +}
Looks good to me. Not a SCSI expert but I checked
scsi_device_supports_vpd() callers and this seems sane.
Attachment:
signature.asc
Description: PGP signature