scsi: rename scsi_build_sense to scsi_convert_sense

After introducing the scsi/ subdirectory, there will be a scsi_build_sense
function that is the same as scsi_req_build_sense but without needing
a SCSIRequest.  The existing scsi_build_sense function gets in the way,
remove it.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2017-08-22 09:31:36 +02:00
parent 14b207487f
commit 37b6045c45
3 changed files with 9 additions and 9 deletions

View File

@ -790,7 +790,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
return 0; return 0;
} }
ret = scsi_build_sense(req->sense, req->sense_len, buf, len, true); ret = scsi_convert_sense(req->sense, req->sense_len, buf, len, true);
/* /*
* FIXME: clearing unit attention conditions upon autosense should be done * FIXME: clearing unit attention conditions upon autosense should be done
@ -811,7 +811,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed) int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed)
{ {
return scsi_build_sense(dev->sense, dev->sense_len, buf, len, fixed); return scsi_convert_sense(dev->sense, dev->sense_len, buf, len, fixed);
} }
void scsi_req_build_sense(SCSIRequest *req, SCSISense sense) void scsi_req_build_sense(SCSIRequest *req, SCSISense sense)
@ -1531,12 +1531,12 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = {
}; };
/* /*
* scsi_build_sense * scsi_convert_sense
* *
* Convert between fixed and descriptor sense buffers * Convert between fixed and descriptor sense buffers
*/ */
int scsi_build_sense(uint8_t *in_buf, int in_len, int scsi_convert_sense(uint8_t *in_buf, int in_len,
uint8_t *buf, int len, bool fixed) uint8_t *buf, int len, bool fixed)
{ {
bool fixed_in; bool fixed_in;
SCSISense sense; SCSISense sense;

View File

@ -1987,8 +1987,8 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
break; break;
case REQUEST_SENSE: case REQUEST_SENSE:
/* Just return "NO SENSE". */ /* Just return "NO SENSE". */
buflen = scsi_build_sense(NULL, 0, outbuf, r->buflen, buflen = scsi_convert_sense(NULL, 0, outbuf, r->buflen,
(req->cmd.buf[1] & 1) == 0); (req->cmd.buf[1] & 1) == 0);
if (buflen < 0) { if (buflen < 0) {
goto illegal_request; goto illegal_request;
} }

View File

@ -244,8 +244,8 @@ extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
uint32_t scsi_data_cdb_xfer(uint8_t *buf); uint32_t scsi_data_cdb_xfer(uint8_t *buf);
uint32_t scsi_cdb_xfer(uint8_t *buf); uint32_t scsi_cdb_xfer(uint8_t *buf);
int scsi_cdb_length(uint8_t *buf); int scsi_cdb_length(uint8_t *buf);
int scsi_build_sense(uint8_t *in_buf, int in_len, int scsi_convert_sense(uint8_t *in_buf, int in_len,
uint8_t *buf, int len, bool fixed); uint8_t *buf, int len, bool fixed);
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
uint32_t tag, uint32_t lun, void *hba_private); uint32_t tag, uint32_t lun, void *hba_private);