From fdaef06917100d97782df550c1807a1da054e27e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 3 Aug 2011 10:49:14 +0200 Subject: scsi: move handling of REPORT LUNS and invalid LUNs to common code Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- hw/scsi-disk.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'hw/scsi-disk.c') 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) { -- cgit v1.2.3