|
Paolo Bonzini |
0fb2b2 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Paolo Bonzini |
0fb2b2 |
Date: Tue, 22 Aug 2017 09:31:36 +0200
|
|
|
59eb7a |
Subject: [PATCH] scsi: rename scsi_build_sense to scsi_convert_sense
|
|
Paolo Bonzini |
0fb2b2 |
MIME-Version: 1.0
|
|
Paolo Bonzini |
0fb2b2 |
Content-Type: text/plain; charset=UTF-8
|
|
Paolo Bonzini |
0fb2b2 |
Content-Transfer-Encoding: 8bit
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
After introducing the scsi/ subdirectory, there will be a scsi_build_sense
|
|
Paolo Bonzini |
0fb2b2 |
function that is the same as scsi_req_build_sense but without needing
|
|
Paolo Bonzini |
0fb2b2 |
a SCSIRequest. The existing scsi_build_sense function gets in the way,
|
|
Paolo Bonzini |
0fb2b2 |
remove it.
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
Paolo Bonzini |
0fb2b2 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Paolo Bonzini |
0fb2b2 |
---
|
|
Paolo Bonzini |
0fb2b2 |
hw/scsi/scsi-bus.c | 10 +++++-----
|
|
Paolo Bonzini |
0fb2b2 |
hw/scsi/scsi-disk.c | 4 ++--
|
|
Paolo Bonzini |
0fb2b2 |
include/hw/scsi/scsi.h | 4 ++--
|
|
Paolo Bonzini |
0fb2b2 |
3 files changed, 9 insertions(+), 9 deletions(-)
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
|
|
Paolo Bonzini |
0fb2b2 |
index ade31c11f5..fac360e20f 100644
|
|
Paolo Bonzini |
0fb2b2 |
--- a/hw/scsi/scsi-bus.c
|
|
Paolo Bonzini |
0fb2b2 |
+++ b/hw/scsi/scsi-bus.c
|
|
Paolo Bonzini |
0fb2b2 |
@@ -790,7 +790,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
|
|
Paolo Bonzini |
0fb2b2 |
return 0;
|
|
Paolo Bonzini |
0fb2b2 |
}
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
- ret = scsi_build_sense(req->sense, req->sense_len, buf, len, true);
|
|
Paolo Bonzini |
0fb2b2 |
+ ret = scsi_convert_sense(req->sense, req->sense_len, buf, len, true);
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
/*
|
|
Paolo Bonzini |
0fb2b2 |
* FIXME: clearing unit attention conditions upon autosense should be done
|
|
Paolo Bonzini |
0fb2b2 |
@@ -811,7 +811,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed)
|
|
Paolo Bonzini |
0fb2b2 |
{
|
|
Paolo Bonzini |
0fb2b2 |
- return scsi_build_sense(dev->sense, dev->sense_len, buf, len, fixed);
|
|
Paolo Bonzini |
0fb2b2 |
+ return scsi_convert_sense(dev->sense, dev->sense_len, buf, len, fixed);
|
|
Paolo Bonzini |
0fb2b2 |
}
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
void scsi_req_build_sense(SCSIRequest *req, SCSISense sense)
|
|
Paolo Bonzini |
0fb2b2 |
@@ -1531,12 +1531,12 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = {
|
|
Paolo Bonzini |
0fb2b2 |
};
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
/*
|
|
Paolo Bonzini |
0fb2b2 |
- * scsi_build_sense
|
|
Paolo Bonzini |
0fb2b2 |
+ * scsi_convert_sense
|
|
Paolo Bonzini |
0fb2b2 |
*
|
|
Paolo Bonzini |
0fb2b2 |
* Convert between fixed and descriptor sense buffers
|
|
Paolo Bonzini |
0fb2b2 |
*/
|
|
Paolo Bonzini |
0fb2b2 |
-int scsi_build_sense(uint8_t *in_buf, int in_len,
|
|
Paolo Bonzini |
0fb2b2 |
- uint8_t *buf, int len, bool fixed)
|
|
Paolo Bonzini |
0fb2b2 |
+int scsi_convert_sense(uint8_t *in_buf, int in_len,
|
|
Paolo Bonzini |
0fb2b2 |
+ uint8_t *buf, int len, bool fixed)
|
|
Paolo Bonzini |
0fb2b2 |
{
|
|
Paolo Bonzini |
0fb2b2 |
bool fixed_in;
|
|
Paolo Bonzini |
0fb2b2 |
SCSISense sense;
|
|
Paolo Bonzini |
0fb2b2 |
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
|
|
Paolo Bonzini |
0fb2b2 |
index 5f1e5e8070..0a1f4ef0c7 100644
|
|
Paolo Bonzini |
0fb2b2 |
--- a/hw/scsi/scsi-disk.c
|
|
Paolo Bonzini |
0fb2b2 |
+++ b/hw/scsi/scsi-disk.c
|
|
Paolo Bonzini |
0fb2b2 |
@@ -1978,8 +1978,8 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
|
|
Paolo Bonzini |
0fb2b2 |
break;
|
|
Paolo Bonzini |
0fb2b2 |
case REQUEST_SENSE:
|
|
Paolo Bonzini |
0fb2b2 |
/* Just return "NO SENSE". */
|
|
Paolo Bonzini |
0fb2b2 |
- buflen = scsi_build_sense(NULL, 0, outbuf, r->buflen,
|
|
Paolo Bonzini |
0fb2b2 |
- (req->cmd.buf[1] & 1) == 0);
|
|
Paolo Bonzini |
0fb2b2 |
+ buflen = scsi_convert_sense(NULL, 0, outbuf, r->buflen,
|
|
Paolo Bonzini |
0fb2b2 |
+ (req->cmd.buf[1] & 1) == 0);
|
|
Paolo Bonzini |
0fb2b2 |
if (buflen < 0) {
|
|
Paolo Bonzini |
0fb2b2 |
goto illegal_request;
|
|
Paolo Bonzini |
0fb2b2 |
}
|
|
Paolo Bonzini |
0fb2b2 |
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
|
|
Paolo Bonzini |
0fb2b2 |
index 6b85786dbf..6ef67fb504 100644
|
|
Paolo Bonzini |
0fb2b2 |
--- a/include/hw/scsi/scsi.h
|
|
Paolo Bonzini |
0fb2b2 |
+++ b/include/hw/scsi/scsi.h
|
|
Paolo Bonzini |
0fb2b2 |
@@ -244,8 +244,8 @@ extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
|
|
Paolo Bonzini |
0fb2b2 |
uint32_t scsi_data_cdb_xfer(uint8_t *buf);
|
|
Paolo Bonzini |
0fb2b2 |
uint32_t scsi_cdb_xfer(uint8_t *buf);
|
|
Paolo Bonzini |
0fb2b2 |
int scsi_cdb_length(uint8_t *buf);
|
|
Paolo Bonzini |
0fb2b2 |
-int scsi_build_sense(uint8_t *in_buf, int in_len,
|
|
Paolo Bonzini |
0fb2b2 |
- uint8_t *buf, int len, bool fixed);
|
|
Paolo Bonzini |
0fb2b2 |
+int scsi_convert_sense(uint8_t *in_buf, int in_len,
|
|
Paolo Bonzini |
0fb2b2 |
+ uint8_t *buf, int len, bool fixed);
|
|
Paolo Bonzini |
0fb2b2 |
|
|
Paolo Bonzini |
0fb2b2 |
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
|
|
Paolo Bonzini |
0fb2b2 |
uint32_t tag, uint32_t lun, void *hba_private);
|