aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-03 10:49:15 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-12 08:31:05 -0500
commit739df2150d7e6291d54b3d2dcbd9ed52078e991c (patch)
treee18479535801438d789d4e094574330a21c2c630 /hw/scsi-disk.c
parentfdaef06917100d97782df550c1807a1da054e27e (diff)
scsi: move handling of REQUEST SENSE 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.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index fe7368ba2c..a33da55663 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -788,12 +788,6 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf)
if (!bdrv_is_inserted(s->bs))
goto not_ready;
break;
- case REQUEST_SENSE:
- if (req->cmd.xfer < 4)
- goto illegal_request;
- buflen = scsi_device_get_sense(&s->qdev, outbuf, req->cmd.xfer,
- (req->cmd.buf[1] & 1) == 0);
- break;
case INQUIRY:
buflen = scsi_disk_emulate_inquiry(req, outbuf);
if (buflen < 0)
@@ -964,7 +958,6 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf)
switch (command) {
case TEST_UNIT_READY:
- case REQUEST_SENSE:
case INQUIRY:
case MODE_SENSE:
case MODE_SENSE_10:
@@ -1063,6 +1056,8 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf)
}
break;
+ case REQUEST_SENSE:
+ abort();
default:
DPRINTF("Unknown SCSI command (%2.2x)\n", buf[0]);
scsi_check_condition(r, SENSE_CODE(INVALID_OPCODE));