diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-11-14 14:31:51 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-11-18 14:12:15 +0100 |
commit | f3b338ef4afaba105357f62143491e51d35c5b42 (patch) | |
tree | 10ba3081b4048e6f42712a12373c0dca5914faf1 /hw/scsi-disk.c | |
parent | 0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0 (diff) | |
download | hqemu-f3b338ef4afaba105357f62143491e51d35c5b42.zip hqemu-f3b338ef4afaba105357f62143491e51d35c5b42.tar.gz |
scsi: pass down REQUEST SENSE to the device when there is no stored sense
This will let scsi-block/scsi-generic report progress on long
operations.
Reported-by: Thomas Schmitt <scdbackup@gmxbackup.net>
Tested-by: Thomas Schmitt <scdbackup@gmxbackup.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 9dd2be8..e3690ec 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1179,6 +1179,11 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r) outbuf[7] = 0; buflen = 8; break; + case REQUEST_SENSE: + /* Just return "NO SENSE". */ + buflen = scsi_build_sense(NULL, 0, outbuf, r->buflen, + (req->cmd.buf[1] & 1) == 0); + break; case MECHANISM_STATUS: buflen = scsi_emulate_mechanism_status(s, outbuf); if (buflen < 0) { @@ -1313,6 +1318,7 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf) case GET_EVENT_STATUS_NOTIFICATION: case MECHANISM_STATUS: case SERVICE_ACTION_IN_16: + case REQUEST_SENSE: case VERIFY_10: rc = scsi_disk_emulate_command(r); if (rc < 0) { @@ -1407,8 +1413,6 @@ 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)); |