aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-bus.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2011-04-18 13:36:02 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-05-26 12:14:16 +0200
commit74382217ca8f25a530c9f63e6b523e6259d7719a (patch)
tree5075f9599c392fde8019c06a293662ee27922ea1 /hw/scsi-bus.c
parent0c34459b6af1b7ed2f000995b9bcb1c722646fbb (diff)
scsi: Implement 'get_sense' callback
The get_sense callback copies existing sense information into the provided buffer. This is required if sense information should be transferred together with the command response. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r--hw/scsi-bus.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 686d59d818..ae16a2d6f7 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -156,6 +156,15 @@ uint8_t *scsi_req_get_buf(SCSIRequest *req)
return req->dev->info->get_buf(req);
}
+int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
+{
+ if (req->dev->info->get_sense) {
+ return req->dev->info->get_sense(req, buf, len);
+ } else {
+ return 0;
+ }
+}
+
int32_t scsi_req_enqueue(SCSIRequest *req, uint8_t *buf)
{
int32_t rc;