aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-08-22 09:43:14 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-09-19 14:09:11 +0200
commit1ead6b4e242e59711976cdf2502dd5c7cd5d340a (patch)
tree22f471aaec74e17dbb5ee7bf8187c4228aaee61d /include
parenta3760467c6b0ff5d1ff952fdc8cec69c65e19499 (diff)
downloadqemu-1ead6b4e242e59711976cdf2502dd5c7cd5d340a.zip
qemu-1ead6b4e242e59711976cdf2502dd5c7cd5d340a.tar.gz
qemu-1ead6b4e242e59711976cdf2502dd5c7cd5d340a.tar.bz2
scsi: introduce sg_io_sense_from_errno
Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for reusability. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/utils.h b/include/scsi/utils.h
index b49392d..d301b31 100644
--- a/include/scsi/utils.h
+++ b/include/scsi/utils.h
@@ -116,6 +116,9 @@ int scsi_cdb_length(uint8_t *buf);
#define SG_ERR_DID_TIME_OUT 0x03
#define SG_ERR_DRIVER_SENSE 0x08
+
+int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr,
+ SCSISense *sense);
#endif
#endif