qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?


From: Fam Zheng
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint
Date: Thu, 22 Mar 2018 10:12:10 +0800
User-agent: Mutt/1.9.2 (2017-12-15)

On Wed, 03/21 11:58, Paolo Bonzini wrote:
> diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
> index 7414fe2d67..b3de5df324 100644
> --- a/hw/scsi/scsi-generic.c
> +++ b/hw/scsi/scsi-generic.c
> @@ -500,9 +500,10 @@ static void scsi_generic_realize(SCSIDevice *s, Error 
> **errp)
>      /* check we are using a driver managing SG_IO (version 3 and after */
>      rc = blk_ioctl(s->conf.blk, SG_GET_VERSION_NUM, &sg_version);
>      if (rc < 0) {
> -        error_setg(errp, "cannot get SG_IO version number: %s.  "
> -                         "Is this a SCSI device?",
> -                         strerror(-rc));
> +        error_setg(errp, "cannot get SG_IO version number: %s", 
> strerror(-rc));
> +        if (rc != -EPERM) {
> +            error_append_hint(errp, "Is this a SCSI device?");
> +        }

Out of the scope of this patch but I find it a bit annoying that hints are not
propagated up in QMP. So that if you hot plug from virsh, the user friendliness
of the old message is lost. Not sure if that is a problem or not.

Fam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]