|
|
9bac43 |
From ddae0e4b41b8bdf17934bce837558bb8eeecb2ea Mon Sep 17 00:00:00 2001
|
|
|
9bac43 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
Date: Sat, 2 Dec 2017 12:19:43 +0100
|
|
|
9bac43 |
Subject: [PATCH 17/36] scsi: rename scsi_build_sense to scsi_convert_sense
|
|
|
9bac43 |
MIME-Version: 1.0
|
|
|
9bac43 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9bac43 |
Content-Transfer-Encoding: 8bit
|
|
|
9bac43 |
|
|
|
9bac43 |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
Message-id: <20171202121953.13317-8-pbonzini@redhat.com>
|
|
|
9bac43 |
Patchwork-id: 78079
|
|
|
9bac43 |
O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH 07/17] scsi: rename scsi_build_sense to scsi_convert_sense
|
|
|
9bac43 |
Bugzilla: 1464908
|
|
|
9bac43 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
9bac43 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
9bac43 |
|
|
|
9bac43 |
After introducing the scsi/ subdirectory, there will be a scsi_build_sense
|
|
|
9bac43 |
function that is the same as scsi_req_build_sense but without needing
|
|
|
9bac43 |
a SCSIRequest. The existing scsi_build_sense function gets in the way,
|
|
|
9bac43 |
remove it.
|
|
|
9bac43 |
|
|
|
9bac43 |
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
9bac43 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9bac43 |
(cherry picked from commit 37b6045c455275af37f0433b05b0dad123e14daf)
|
|
|
9bac43 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9bac43 |
---
|
|
|
9bac43 |
hw/scsi/scsi-bus.c | 10 +++++-----
|
|
|
9bac43 |
hw/scsi/scsi-disk.c | 4 ++--
|
|
|
9bac43 |
include/hw/scsi/scsi.h | 4 ++--
|
|
|
9bac43 |
3 files changed, 9 insertions(+), 9 deletions(-)
|
|
|
9bac43 |
|
|
|
9bac43 |
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
|
|
|
9bac43 |
index 55aa5a7..256610a 100644
|
|
|
9bac43 |
--- a/hw/scsi/scsi-bus.c
|
|
|
9bac43 |
+++ b/hw/scsi/scsi-bus.c
|
|
|
9bac43 |
@@ -798,7 +798,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
|
|
|
9bac43 |
return 0;
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
- ret = scsi_build_sense(req->sense, req->sense_len, buf, len, true);
|
|
|
9bac43 |
+ ret = scsi_convert_sense(req->sense, req->sense_len, buf, len, true);
|
|
|
9bac43 |
|
|
|
9bac43 |
/*
|
|
|
9bac43 |
* FIXME: clearing unit attention conditions upon autosense should be done
|
|
|
9bac43 |
@@ -819,7 +819,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
|
|
|
9bac43 |
|
|
|
9bac43 |
int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
- return scsi_build_sense(dev->sense, dev->sense_len, buf, len, fixed);
|
|
|
9bac43 |
+ return scsi_convert_sense(dev->sense, dev->sense_len, buf, len, fixed);
|
|
|
9bac43 |
}
|
|
|
9bac43 |
|
|
|
9bac43 |
void scsi_req_build_sense(SCSIRequest *req, SCSISense sense)
|
|
|
9bac43 |
@@ -1539,12 +1539,12 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = {
|
|
|
9bac43 |
};
|
|
|
9bac43 |
|
|
|
9bac43 |
/*
|
|
|
9bac43 |
- * scsi_build_sense
|
|
|
9bac43 |
+ * scsi_convert_sense
|
|
|
9bac43 |
*
|
|
|
9bac43 |
* Convert between fixed and descriptor sense buffers
|
|
|
9bac43 |
*/
|
|
|
9bac43 |
-int scsi_build_sense(uint8_t *in_buf, int in_len,
|
|
|
9bac43 |
- uint8_t *buf, int len, bool fixed)
|
|
|
9bac43 |
+int scsi_convert_sense(uint8_t *in_buf, int in_len,
|
|
|
9bac43 |
+ uint8_t *buf, int len, bool fixed)
|
|
|
9bac43 |
{
|
|
|
9bac43 |
bool fixed_in;
|
|
|
9bac43 |
SCSISense sense;
|
|
|
9bac43 |
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
|
|
|
9bac43 |
index 21d6b4e..b7714e3 100644
|
|
|
9bac43 |
--- a/hw/scsi/scsi-disk.c
|
|
|
9bac43 |
+++ b/hw/scsi/scsi-disk.c
|
|
|
9bac43 |
@@ -1996,8 +1996,8 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
|
|
|
9bac43 |
break;
|
|
|
9bac43 |
case REQUEST_SENSE:
|
|
|
9bac43 |
/* Just return "NO SENSE". */
|
|
|
9bac43 |
- buflen = scsi_build_sense(NULL, 0, outbuf, r->buflen,
|
|
|
9bac43 |
- (req->cmd.buf[1] & 1) == 0);
|
|
|
9bac43 |
+ buflen = scsi_convert_sense(NULL, 0, outbuf, r->buflen,
|
|
|
9bac43 |
+ (req->cmd.buf[1] & 1) == 0);
|
|
|
9bac43 |
if (buflen < 0) {
|
|
|
9bac43 |
goto illegal_request;
|
|
|
9bac43 |
}
|
|
|
9bac43 |
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
|
|
|
9bac43 |
index 6b85786..6ef67fb 100644
|
|
|
9bac43 |
--- a/include/hw/scsi/scsi.h
|
|
|
9bac43 |
+++ b/include/hw/scsi/scsi.h
|
|
|
9bac43 |
@@ -244,8 +244,8 @@ extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
|
|
|
9bac43 |
uint32_t scsi_data_cdb_xfer(uint8_t *buf);
|
|
|
9bac43 |
uint32_t scsi_cdb_xfer(uint8_t *buf);
|
|
|
9bac43 |
int scsi_cdb_length(uint8_t *buf);
|
|
|
9bac43 |
-int scsi_build_sense(uint8_t *in_buf, int in_len,
|
|
|
9bac43 |
- uint8_t *buf, int len, bool fixed);
|
|
|
9bac43 |
+int scsi_convert_sense(uint8_t *in_buf, int in_len,
|
|
|
9bac43 |
+ uint8_t *buf, int len, bool fixed);
|
|
|
9bac43 |
|
|
|
9bac43 |
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
|
|
|
9bac43 |
uint32_t tag, uint32_t lun, void *hba_private);
|
|
|
9bac43 |
--
|
|
|
9bac43 |
1.8.3.1
|
|
|
9bac43 |
|