aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-03 10:49:19 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-12 08:31:28 -0500
commit98254542f9aca81f136a96c82a9ae08e781a9baf (patch)
tree55930c014871ecae7b82876d5179ae6734dc119a /hw
parentc7b488721d6aafe32994ac63f8d690ae6d4729fa (diff)
scsi: add special traces for common commands
Can be useful when debugging the device scan phase. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi-bus.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 9b2d12dc48..f2af6cdb4d 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -396,6 +396,23 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
}
req->cmd = cmd;
+ switch (buf[0]) {
+ case INQUIRY:
+ trace_scsi_inquiry(d->id, lun, tag, cmd.buf[1], cmd.buf[2]);
+ break;
+ case TEST_UNIT_READY:
+ trace_scsi_test_unit_ready(d->id, lun, tag);
+ break;
+ case REPORT_LUNS:
+ trace_scsi_report_luns(d->id, lun, tag);
+ break;
+ case REQUEST_SENSE:
+ trace_scsi_request_sense(d->id, lun, tag);
+ break;
+ default:
+ break;
+ }
+
return req;
}