qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] scsi: Improve error messages more
Date: Fri, 16 May 2014 15:33:26 +0800	[thread overview]
Message-ID: <20140516073326.GC1941@T430.nay.redhat.com> (raw)
In-Reply-To: <1398685153-15146-1-git-send-email-pbonzini@redhat.com>

On Mon, 04/28 13:39, Paolo Bonzini wrote:
> Remove the "scsi-block:" prefix for error messages as suggested
> by Markus.
> 
> Improve the previous patch by making the message the same for both
> scsi-block and scsi-generic, including the strerror() output in both
> and making an explicit reference to SG_IO.  Also s/can not/cannot/.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo, I think there are a small number of scsi-next patches queued now, are
you going to send a PULL request?

Thanks,
Fam

> ---
>  hw/scsi/scsi-disk.c    | 11 ++++++-----
>  hw/scsi/scsi-generic.c |  8 ++++++--
>  2 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index d2e532e..4bcef55 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -2458,26 +2458,27 @@ static int scsi_block_initfn(SCSIDevice *dev)
>      int rc;
>  
>      if (!s->qdev.conf.bs) {
> -        error_report("scsi-block: drive property not set");
> +        error_report("drive property not set");
>          return -1;
>      }
>  
>      /* check we are using a driver managing SG_IO (version 3 and after) */
> -    rc =  bdrv_ioctl(s->qdev.conf.bs, SG_GET_VERSION_NUM, &sg_version);
> +    rc = bdrv_ioctl(s->qdev.conf.bs, SG_GET_VERSION_NUM, &sg_version);
>      if (rc < 0) {
> -        error_report("scsi-block: can not get version number: %s",
> +        error_report("cannot get SG_IO version number: %s.  "
> +                     "Is this a SCSI device?",
>                       strerror(-rc));
>          return -1;
>      }
>      if (sg_version < 30000) {
> -        error_report("scsi-block: scsi generic interface too old");
> +        error_report("scsi generic interface too old");
>          return -1;
>      }
>  
>      /* get device type from INQUIRY data */
>      rc = get_device_type(s);
>      if (rc < 0) {
> -        error_report("scsi-block: INQUIRY failed");
> +        error_report("INQUIRY failed");
>          return -1;
>      }
>  
> diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
> index 8d92e0d..3733d2c 100644
> --- a/hw/scsi/scsi-generic.c
> +++ b/hw/scsi/scsi-generic.c
> @@ -394,6 +394,7 @@ static void scsi_destroy(SCSIDevice *s)
>  
>  static int scsi_generic_initfn(SCSIDevice *s)
>  {
> +    int rc;
>      int sg_version;
>      struct sg_scsi_id scsiid;
>  
> @@ -412,8 +413,11 @@ static int scsi_generic_initfn(SCSIDevice *s)
>      }
>  
>      /* check we are using a driver managing SG_IO (version 3 and after */
> -    if (bdrv_ioctl(s->conf.bs, SG_GET_VERSION_NUM, &sg_version) < 0) {
> -        error_report("scsi generic interface not supported");
> +    rc = bdrv_ioctl(s->conf.bs, SG_GET_VERSION_NUM, &sg_version);
> +    if (rc < 0) {
> +        error_report("cannot get SG_IO version number: %s.  "
> +                     "Is this a SCSI device?",
> +                     strerror(-rc));
>          return -1;
>      }
>      if (sg_version < 30000) {
> -- 
> 1.8.3.1
> 
> 

       reply	other threads:[~2014-05-16  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1398685153-15146-1-git-send-email-pbonzini@redhat.com>
2014-05-16  7:33 ` Fam Zheng [this message]
2014-05-16  8:25   ` [Qemu-devel] [PATCH v2] scsi: Improve error messages more Paolo Bonzini
2014-05-16  8:33     ` Fam Zheng

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=20140516073326.GC1941@T430.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).