diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-08-03 10:49:14 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-12 08:30:20 -0500 |
commit | fdaef06917100d97782df550c1807a1da054e27e (patch) | |
tree | bf695288839d64bb1077e176a45ac82400bfc1c3 /hw/scsi-disk.c | |
parent | afa46c468acc18914c2773538f1b088c507766ee (diff) |
scsi: move handling of REPORT LUNS and invalid LUNs to common code
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 1abf90952b..fe7368ba2c 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -482,11 +482,6 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) memset(outbuf, 0, buflen); - if (req->lun) { - outbuf[0] = 0x7f; /* LUN not supported */ - return buflen; - } - outbuf[0] = s->qdev.type & 0x1f; if (s->qdev.type == TYPE_ROM) { outbuf[1] = 0x80; @@ -918,13 +913,6 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf) } DPRINTF("Unsupported Service Action In\n"); goto illegal_request; - case REPORT_LUNS: - if (req->cmd.xfer < 16) - goto illegal_request; - memset(outbuf, 0, 16); - outbuf[3] = 8; - buflen = 16; - break; case VERIFY_10: break; default: @@ -974,14 +962,6 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf) } #endif - if (req->lun) { - /* Only LUN 0 supported. */ - DPRINTF("Unimplemented LUN %d\n", req->lun); - if (command != REQUEST_SENSE && command != INQUIRY) { - scsi_check_condition(r, SENSE_CODE(LUN_NOT_SUPPORTED)); - return 0; - } - } switch (command) { case TEST_UNIT_READY: case REQUEST_SENSE: @@ -999,7 +979,6 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf) case READ_TOC: case GET_CONFIGURATION: case SERVICE_ACTION_IN: - case REPORT_LUNS: case VERIFY_10: rc = scsi_disk_emulate_command(r, outbuf); if (rc < 0) { |