aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-generic.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-03 10:49:13 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-12 08:29:01 -0500
commitafa46c468acc18914c2773538f1b088c507766ee (patch)
treea190df34a155899f06a4f13e521efb0ffb86b52e /hw/scsi-generic.c
parent87dcd1b2c27e88a47be5036e9cf4c2767054eb31 (diff)
downloadqemu-afa46c468acc18914c2773538f1b088c507766ee.zip
qemu-afa46c468acc18914c2773538f1b088c507766ee.tar.gz
qemu-afa46c468acc18914c2773538f1b088c507766ee.tar.bz2
scsi: move request parsing to common code
Also introduce the first occurrence of "independent" SCSIReqOps, to handle invalid commands in common code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-generic.c')
-rw-r--r--hw/scsi-generic.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 8046ea6..3b43f1c 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -84,10 +84,6 @@ static void scsi_command_complete(void *opaque, int ret)
case -EDOM:
status = TASK_SET_FULL;
break;
- case -EINVAL:
- status = CHECK_CONDITION;
- scsi_req_build_sense(&r->req, SENSE_CODE(INVALID_FIELD));
- break;
case -ENOMEM:
status = CHECK_CONDITION;
scsi_req_build_sense(&r->req, SENSE_CODE(TARGET_FAILURE));
@@ -298,11 +294,6 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
return 0;
}
- if (-1 == scsi_req_parse(&r->req, cmd)) {
- BADF("Unsupported command length, command %x\n", cmd[0]);
- scsi_command_complete(r, -EINVAL);
- return 0;
- }
scsi_req_fixup(&r->req);
DPRINTF("Command: lun=%d tag=0x%x len %zd data=0x%02x", lun, tag,