[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/14] scsi: do not require a minimum allocation len
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 10/14] scsi: do not require a minimum allocation length for INQUIRY |
Date: |
Fri, 4 May 2012 10:45:50 +0200 |
The requirements on the INQUIRY 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 | 8 --------
hw/scsi-disk.c | 11 -----------
2 files changed, 19 deletions(-)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 46cd1f9..4090b9f 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -367,10 +367,6 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r)
if (r->req.cmd.buf[1] & 0x1) {
/* Vital product data */
uint8_t page_code = r->req.cmd.buf[2];
- if (r->req.cmd.xfer < 4) {
- return false;
- }
-
r->buf[r->len++] = page_code ; /* this page */
r->buf[r->len++] = 0x00;
@@ -398,10 +394,6 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r)
}
/* PAGE CODE == 0 */
- if (r->req.cmd.xfer < 5) {
- return false;
- }
-
r->len = MIN(r->req.cmd.xfer, 36);
memset(r->buf, 0, r->len);
if (r->req.lun != 0) {
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index e0f1821..298b4ef 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -524,11 +524,6 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req,
uint8_t *outbuf)
if (req->cmd.buf[1] & 0x1) {
/* Vital product data */
uint8_t page_code = req->cmd.buf[2];
- if (req->cmd.xfer < 4) {
- BADF("Error: Inquiry (EVPD[%02X]) buffer size %zd is "
- "less than 4\n", page_code, req->cmd.xfer);
- return -1;
- }
outbuf[buflen++] = s->qdev.type & 0x1f;
outbuf[buflen++] = page_code ; // this page
@@ -659,12 +654,6 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req,
uint8_t *outbuf)
}
/* PAGE CODE == 0 */
- if (req->cmd.xfer < 5) {
- BADF("Error: Inquiry (STANDARD) buffer size %zd "
- "is less than 5\n", req->cmd.xfer);
- return -1;
- }
-
buflen = req->cmd.xfer;
if (buflen > SCSI_MAX_INQUIRY_LEN) {
buflen = SCSI_MAX_INQUIRY_LEN;
--
1.7.9.3
- Re: [Qemu-devel] [PATCH 06/14] scsi: change "removable" field to host many features, (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, 2012/05/04
[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 <=
[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