diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-24 16:30:09 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-25 14:14:32 +0100 |
commit | d7a84021db8eeddcd5d24ab591a1434763caff6c (patch) | |
tree | b176dbb666400680650b9f5a0fc8b22855ffcb65 /include | |
parent | 424740def9a42da88550410de9a41ef07cc4a010 (diff) |
scsi: introduce scsi_sense_from_errno()
The new function is an extension of the switch statement in scsi-disk.c
which also includes the errno cases only found in sg_io_sense_from_errno.
This allows us to consolidate the errno handling.
Extracted from a patch by Hannes Reinecke <hare@suse.de>.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/scsi/utils.h b/include/scsi/utils.h index 096489c6cd..ff7c7091b6 100644 --- a/include/scsi/utils.h +++ b/include/scsi/utils.h @@ -135,4 +135,6 @@ int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr, SCSISense *sense); #endif +int scsi_sense_from_errno(int errno_value, SCSISense *sense); + #endif |