From afa46c468acc18914c2773538f1b088c507766ee Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 3 Aug 2011 10:49:13 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- hw/scsi-generic.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'hw/scsi-generic.c') diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 8046ea61ee..3b43f1c7e2 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, -- cgit v1.2.3