aboutsummaryrefslogtreecommitdiff
path: root/scsi
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2020-11-16 19:40:38 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-03-06 11:41:54 +0100
commit41af878b96582fc8c83303ab8921e40468403702 (patch)
tree095e9c1818466f947a841b7ad2a86716e931d25b /scsi
parentf7544edcd32e602af1aae86714dc7c32350d5d7c (diff)
downloadqemu-41af878b96582fc8c83303ab8921e40468403702.zip
qemu-41af878b96582fc8c83303ab8921e40468403702.tar.gz
qemu-41af878b96582fc8c83303ab8921e40468403702.tar.bz2
scsi: Rename linux-specific SG_ERR codes to generic SCSI_HOST error codes
We really should make a distinction between legitimate sense codes (ie if one is running against an emulated block device or for pass-through sense codes), and the intermediate errors generated during processing of the command, which really are not sense codes but refer to some specific internal status. And this internal state is not necessarily linux-specific, but rather can refer to the qemu implementation itself. So rename the linux-only SG_ERR codes to SCSI_HOST codes and make them available generally. Signed-off-by: Hannes Reinecke <hare@suse.de> Message-Id: <20201116184041.60465-5-hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scsi')
-rw-r--r--scsi/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/scsi/utils.c b/scsi/utils.c
index 6b56e01..4d994b6 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -612,9 +612,9 @@ int sg_io_sense_from_errno(int errno_value, struct sg_io_hdr *io_hdr,
if (errno_value != 0) {
return scsi_sense_from_errno(errno_value, sense);
} else {
- if (io_hdr->host_status == SG_ERR_DID_NO_CONNECT ||
- io_hdr->host_status == SG_ERR_DID_BUS_BUSY ||
- io_hdr->host_status == SG_ERR_DID_TIME_OUT ||
+ if (io_hdr->host_status == SCSI_HOST_NO_LUN ||
+ io_hdr->host_status == SCSI_HOST_BUSY ||
+ io_hdr->host_status == SCSI_HOST_TIME_OUT ||
(io_hdr->driver_status & SG_ERR_DRIVER_TIMEOUT)) {
return BUSY;
} else if (io_hdr->host_status) {