diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-06 11:18:53 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-14 13:38:03 +0100 |
commit | aa7a6a399f8253d3831465b1db8544032b49f57a (patch) | |
tree | 371bbd515032a5422f8580c0f1cd7f624b0f5c88 /hw/scsi | |
parent | 2e323f03bfa323636552b386c982412944ff86ae (diff) | |
download | hqemu-aa7a6a399f8253d3831465b1db8544032b49f57a.zip hqemu-aa7a6a399f8253d3831465b1db8544032b49f57a.tar.gz |
virtio-scsi: actually honor sense_size from configuration space
We were always truncating the sense size to 96 bytes.
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi')
-rw-r--r-- | hw/scsi/virtio-scsi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 6610b3a..b0d7517 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -304,6 +304,8 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status, size_t resid) { VirtIOSCSIReq *req = r->hba_private; + VirtIOSCSI *s = req->dev; + VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); uint32_t sense_len; if (r->io_canceled) { @@ -317,7 +319,7 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status, } else { req->resp.cmd->resid = 0; sense_len = scsi_req_get_sense(r, req->resp.cmd->sense, - VIRTIO_SCSI_SENSE_SIZE); + vs->sense_size); req->resp.cmd->sense_len = tswap32(sense_len); } virtio_scsi_complete_req(req); |