qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Alistair Francis <alistair23@gmail.com>
Cc: "fam@euphon.net" <fam@euphon.net>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v1 1/1] hw/scsi: Report errors and sense to guests through scsi-block
Date: Tue, 2 Jul 2019 06:44:03 +0000	[thread overview]
Message-ID: <CY1PR04MB22683409CB203BF5042697FBEDF80@CY1PR04MB2268.namprd04.prod.outlook.com> (raw)
In-Reply-To: 79c9e21f-06b1-6255-97af-95c08b354c8a@redhat.com

On 7/1/19 8:56 PM, Paolo Bonzini wrote:
> On 01/07/19 12:14, Shinichiro Kawasaki wrote:
>> I observe four of them listed below in sense data,
>> when I ran basic operations to the zoned storage from the guest via scsi-block.
>>
>>       21h 04h: UNALIGNED WRITE COMMAND
>>       21h 05h: WRITE BOUNDARY VIOLATION
>>       21h 06h: ATTEMPT TO READ INVALID DATA
>>       55h 0Eh: INSUFFICIENT ZONE RESOURCES
>>
>> These ASCs can be reported for write or read commands due to unexpected zone
>> status or write pointer status. Reporting these ASCs to the guest, the user
>> applications can handle them to manage zone/write pointer status, or help the
>> user application developers to understand the failure reason and fix bugs.
>>
>> I took a look in scsi_sense_to_errno() and learned that ASCs are grouped in
>> errnos. To report the ASCs above to the guest, is it good to add them in EINVAL
>> group defined in scsi_sense_to_errno()? The ASCs are reported with sense key
>> ILLEGAL_REQUEST or DATA_PROTECT, then I think it fits in the function.
> 
> The grouping by errno is historical and pretty much broken.  It should
> be possible to change it to return just a bool.

The errno grouping of scsi_sense_to_errno() is used not only by scsi-disk but 
also by block/iscsi for error reporting. Can we avoid errno grouping for iscsi also?

If the errno grouping is not valuable for iscsi, single error code (EIO?) can be 
reported for all iscsi failures. If the errno grouping is useful for iscsi, I 
can create a patch to avoid errno grouping only for scsi-disk, leaving 
scsi_sense_to_errno() for iscsi.

-- 
Best Regards,
Shin'ichiro Kawasaki


  reply	other threads:[~2019-07-02  7:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 22:46 [Qemu-devel] [PATCH v1 1/1] hw/scsi: Report errors and sense to guests through scsi-block Alistair Francis
2019-06-27  9:01 ` Paolo Bonzini
2019-06-28 21:57   ` Alistair Francis
2019-06-28 22:14     ` Paolo Bonzini
2019-06-28 22:18       ` Alistair Francis
2019-07-01 10:14         ` Shinichiro Kawasaki
2019-07-01 11:56           ` Paolo Bonzini
2019-07-02  6:44             ` Shinichiro Kawasaki [this message]
2019-07-02 10:22               ` Paolo Bonzini
2019-07-05 10:31                 ` Shinichiro Kawasaki
2019-07-05 17:08                   ` Paolo Bonzini
2019-07-09  8:27                     ` Shinichiro Kawasaki

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=CY1PR04MB22683409CB203BF5042697FBEDF80@CY1PR04MB2268.namprd04.prod.outlook.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=fam@euphon.net \
    --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).