bdev_virtio: fix scan inquiry alloc_len

Some devices expect alloc_len
to be the same as payload len.

Kernel vhost-scsi reports:
Expected Transfer Length: 256 does
not match SCSI CDB Length: 255 for
SAM Opcode: 0x12.

Change-Id: I499290c207b77be6757441da002f9fcc9eebcecd
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383779
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-25 19:45:33 +02:00 committed by Daniel Verkamp
parent cfa668375b
commit 5447fb12a9

View File

@ -889,7 +889,7 @@ scan_target(struct virtio_scsi_scan_base *base)
cdb = (struct spdk_scsi_cdb_inquiry *)req->cdb; cdb = (struct spdk_scsi_cdb_inquiry *)req->cdb;
cdb->opcode = SPDK_SPC_INQUIRY; cdb->opcode = SPDK_SPC_INQUIRY;
cdb->alloc_len[1] = 255; to_be16(cdb->alloc_len, BDEV_VIRTIO_SCAN_PAYLOAD_SIZE);
base->retries = SCAN_REQUEST_RETRIES; base->retries = SCAN_REQUEST_RETRIES;
return virtio_xmit_pkt(base->vq, vreq); return virtio_xmit_pkt(base->vq, vreq);