qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: famz@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 01/10] scsi: rename scsi_convert_sense
Date: Tue, 22 Aug 2017 10:38:31 -0300	[thread overview]
Message-ID: <13c0147f-b87d-88f8-1a77-3b026b487190@amsat.org> (raw)
In-Reply-To: <20170822131832.20191-2-pbonzini@redhat.com>

On 08/22/2017 10:18 AM, Paolo Bonzini wrote:
> 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.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   hw/scsi/scsi-bus.c     | 10 +++++-----
>   hw/scsi/scsi-disk.c    |  4 ++--
>   include/hw/scsi/scsi.h |  4 ++--
>   3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
> index e364410a23..890f8fcc83 100644
> --- a/hw/scsi/scsi-bus.c
> +++ b/hw/scsi/scsi-bus.c
> @@ -769,7 +769,7 @@ int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len)
>           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
> @@ -790,7 +790,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)
>   {
> -    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)
> @@ -1510,12 +1510,12 @@ const struct SCSISense sense_code_SPACE_ALLOC_FAILED = {
>   };
>   
>   /*
> - * scsi_build_sense
> + * scsi_convert_sense
>    *
>    * Convert between fixed and descriptor sense buffers
>    */
> -int scsi_build_sense(uint8_t *in_buf, int in_len,
> -                     uint8_t *buf, int len, bool fixed)
> +int scsi_convert_sense(uint8_t *in_buf, int in_len,
> +                       uint8_t *buf, int len, bool fixed)
>   {
>       bool fixed_in;
>       SCSISense sense;
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 5f1e5e8070..0a1f4ef0c7 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1978,8 +1978,8 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>           break;
>       case REQUEST_SENSE:
>           /* Just return "NO SENSE".  */
> -        buflen = scsi_build_sense(NULL, 0, outbuf, r->buflen,
> -                                  (req->cmd.buf[1] & 1) == 0);
> +        buflen = scsi_convert_sense(NULL, 0, outbuf, r->buflen,
> +                                    (req->cmd.buf[1] & 1) == 0);
>           if (buflen < 0) {
>               goto illegal_request;
>           }
> diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
> index 6b85786dbf..6ef67fb504 100644
> --- a/include/hw/scsi/scsi.h
> +++ b/include/hw/scsi/scsi.h
> @@ -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_cdb_xfer(uint8_t *buf);
>   int scsi_cdb_length(uint8_t *buf);
> -int scsi_build_sense(uint8_t *in_buf, int in_len,
> -                     uint8_t *buf, int len, bool fixed);
> +int scsi_convert_sense(uint8_t *in_buf, int in_len,
> +                       uint8_t *buf, int len, bool fixed);
>   
>   SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
>                               uint32_t tag, uint32_t lun, void *hba_private);
> 

  reply	other threads:[~2017-08-22 13:38 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 13:18 [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 01/10] scsi: rename scsi_convert_sense Paolo Bonzini
2017-08-22 13:38   ` Philippe Mathieu-Daudé [this message]
2017-08-22 13:18 ` [Qemu-devel] [PATCH 02/10] scsi: move non-emulation specific code to scsi/ Paolo Bonzini
2017-08-22 13:34   ` Philippe Mathieu-Daudé
2017-08-22 13:18 ` [Qemu-devel] [PATCH 03/10] scsi: introduce scsi_build_sense Paolo Bonzini
2017-08-22 13:35   ` Philippe Mathieu-Daudé
2017-08-30 13:39   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno Paolo Bonzini
2017-08-22 13:45   ` Philippe Mathieu-Daudé
2017-08-22 13:53     ` Paolo Bonzini
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h Paolo Bonzini
2017-08-22 13:37   ` Philippe Mathieu-Daudé
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management Paolo Bonzini
2017-08-23  4:13   ` Fam Zheng
2017-08-23  6:56     ` Paolo Bonzini
2017-08-24 15:37   ` Eric Blake
2017-08-24 15:47     ` Paolo Bonzini
2017-08-30 12:59   ` Daniel P. Berrange
2017-08-30 14:26   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 07/10] io: add qio_channel_read/write_all Paolo Bonzini
2017-08-23  5:08   ` Fam Zheng
2017-08-23  6:54     ` Paolo Bonzini
2017-08-30 12:52   ` Daniel P. Berrange
2017-08-30 14:33   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 08/10] scsi: build qemu-pr-helper Paolo Bonzini
2017-08-22 14:34   ` Marc-André Lureau
2017-08-22 16:04     ` Paolo Bonzini
2017-08-24 15:45   ` Eric Blake
2017-08-30 15:44   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper Paolo Bonzini
2017-08-23  5:01   ` Fam Zheng
2017-08-23  6:50     ` Paolo Bonzini
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-30 16:37   ` Stefan Hajnoczi
2017-09-11  9:14     ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper Paolo Bonzini
2017-08-23  4:49   ` Fam Zheng
2017-08-23  6:55     ` Paolo Bonzini
2017-08-23  7:48     ` Paolo Bonzini
2017-08-30 16:58   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:48 ` [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:51 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13c0147f-b87d-88f8-1a77-3b026b487190@amsat.org \
    --to=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).