orion / rpms / qemu

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