[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/14] scsi: do not require a minimum allocation len
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 11/14] scsi: do not require a minimum allocation length for REQUEST SENSE |
Date: |
Fri, 4 May 2012 10:45:51 +0200 |
The requirements on the REQUEST SENSE buffer size are not in my copy of SPC
(SPC-4 r27) and not observed by LIO. Rip them out.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi-bus.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 4090b9f..925c3ae 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -427,9 +427,6 @@ static int32_t scsi_target_send_command(SCSIRequest *req,
uint8_t *buf)
}
break;
case REQUEST_SENSE:
- if (req->cmd.xfer < 4) {
- goto illegal_request;
- }
r->len = scsi_device_get_sense(r->req.dev, r->buf,
MIN(req->cmd.xfer, sizeof r->buf),
(req->cmd.buf[1] & 1) == 0);
@@ -538,8 +535,8 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag,
uint32_t lun,
req = scsi_req_alloc(&reqops_unit_attention, d, tag, lun,
hba_private);
} else if (lun != d->lun ||
- buf[0] == REPORT_LUNS ||
- (buf[0] == REQUEST_SENSE && (d->sense_len || cmd.xfer < 4))) {
+ buf[0] == REPORT_LUNS ||
+ (buf[0] == REQUEST_SENSE && d->sense_len)) {
req = scsi_req_alloc(&reqops_target_command, d, tag, lun,
hba_private);
} else {
--
1.7.9.3
- [Qemu-devel] [PATCH 04/14] scsi: fix WRITE SAME transfer length and direction, (continued)
- [Qemu-devel] [PATCH 07/14] scsi-disk: add dpofua property, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 08/14] scsi: do not report bogus overruns for commands in the 0x00-0x1F range, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 09/14] scsi: parse 16-byte tape CDBs, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 11/14] scsi: do not require a minimum allocation length for REQUEST SENSE,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 12/14] scsi: set VALID bit to 0 in fixed format sense data, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 13/14] scsi: remove useless debug messages, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 10/14] scsi: do not require a minimum allocation length for INQUIRY, Paolo Bonzini, 2012/05/04
- [Qemu-devel] [PATCH 14/14] scsi: Add assertion for use-after-free errors, Paolo Bonzini, 2012/05/04
- Re: [Qemu-devel] [PULL 00/14] SCSI changes for 1.1, Anthony Liguori, 2012/05/08