qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 1/1] hw/scsi: Report errors and sense to gues


From: Shinichiro Kawasaki
Subject: Re: [Qemu-devel] [PATCH v1 1/1] hw/scsi: Report errors and sense to guests through scsi-block
Date: Mon, 1 Jul 2019 10:14:42 +0000

On 6/29/19 7:21 AM, Alistair Francis wrote:
> On Fri, Jun 28, 2019 at 3:14 PM Paolo Bonzini <address@hidden> wrote:
>>
>> On 28/06/19 23:57, Alistair Francis wrote:
>>>
>>> I tried to run my VM with option "-drive
>>> ...,rerror=report,werror=report" as he noted, but the eternal loop
>>> symptom still happens when host block-scsi device returns EIO. Then I
>>> believe EIO should be added to the report target error list.
>>
>> What is the sense data he's seeing?  EIO is a catch-all return value
>> for scsi_sense_buf_to_errno so I'd rather be more specific.
> 
> I'm not sure, he is CCed to this email so he should respond with more
> information.

Hi Paolo, thank you very much for your review and comments.
(Alistair, thank you for your care for the patch post)

The sense data I observe are related to 'zoned storage'. Now I'm trying to make 
zoned storage on host visible to qemu guests through scsi-block driver, to 
utilize qemu guest environment for zoned storage system development.

     'zonedstroage.io' is the good reference for details of the zoned storage.
     http://zonedstorage.io/introduction/zoned-storage/

The zoned storage introduced "zone" and "write pointer" concepts, and SCSI spec 
documents were updated to define additional commands for zoned storage as well 
as Additional Sense Codes. The latest SPC-5 defines a number of ASCs that zoned 
SCSI storage devices return. 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.

-- 
Best Regards,
Shin'ichiro Kawasaki



reply via email to

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