From: Paolo Bonzini <pbonzini@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 5/7] scsi: Add mapping for generic SCSI_HOST status to sense codes
Date: Mon, 16 Nov 2020 21:05:35 +0100 [thread overview]
Message-ID: <10dbdf68-20df-8517-e16b-f6c1baa4c8fc@redhat.com> (raw)
In-Reply-To: <931dd292-e5fb-4956-aaaf-02429a61b730@suse.de>
On 16/11/20 20:03, Hannes Reinecke wrote:
>>
>>> + case SCSI_HOST_TARGET_FAILURE:
>>> + *sense = SENSE_CODE(TARGET_FAILURE);
>>> + return CHECK_CONDITION;
>>> + case SCSI_HOST_RESERVATION_ERROR:
>>> + return RESERVATION_CONFLICT;
>>> + case SCSI_HOST_ALLOCATION_FAILURE:
>>> + *sense = SENSE_CODE(SPACE_ALLOC_FAILED);
>>> + return CHECK_CONDITION;
>>> + case SCSI_HOST_MEDIUM_ERROR:
>>> + *sense = SENSE_CODE(READ_ERROR);
>>> + return CHECK_CONDITION;
>>
>> Can these actually be visible to userspace? I'd rather avoid having
>> them in QEMU if possible.
>>
>> Otherwise, the patches are completely sensible.
>>
> And I did it exactly for the opposite purpose: rather than painstakingly
> figuring out which codes _might_ be returned (and be utterly surprised
> if we missed some) add an interpretation for every _possible_ code,
> avoiding nasty surprises.
And that certainly makes sense too.
On the other hand it'd be nice if Linux was clearer about which the
SCSI_HOST values are part of the userspace API and which are just an
(ugly) implementation detail.
Paolo
next prev parent reply other threads:[~2020-11-16 20:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 18:40 [PATCH 0/7] scsi: scsi-disk corrupts data Hannes Reinecke
2020-11-16 18:40 ` [PATCH 1/7] scsi-disk: Add sg_io callback to evaluate status Hannes Reinecke
2020-11-16 18:40 ` [PATCH 2/7] scsi: drop 'result' argument from command_complete callback Hannes Reinecke
2020-11-16 18:40 ` [PATCH 3/7] scsi-disk: convert more errno values back to SCSI statuses Hannes Reinecke
2020-11-16 18:40 ` [PATCH 4/7] scsi: Rename linux-specific SG_ERR codes to generic SCSI_HOST error codes Hannes Reinecke
2020-11-16 18:40 ` [PATCH 5/7] scsi: Add mapping for generic SCSI_HOST status to sense codes Hannes Reinecke
2020-11-16 18:57 ` Paolo Bonzini
2020-11-16 19:03 ` Hannes Reinecke
2020-11-16 20:05 ` Paolo Bonzini [this message]
2020-11-17 6:53 ` Hannes Reinecke
2020-11-16 18:40 ` [PATCH 6/7] scsi: split sg_io_sense_from_errno() in two functions Hannes Reinecke
2020-11-16 18:40 ` [PATCH 7/7] scsi: move host_status handling into SCSI drivers Hannes Reinecke
2020-11-16 18:58 ` Paolo Bonzini
2020-11-16 19:05 ` Hannes Reinecke
2020-11-16 22:00 ` Paolo Bonzini
2020-11-17 6:55 ` Hannes Reinecke
2020-11-17 7:38 ` Paolo Bonzini
2020-11-17 8:50 ` Hannes Reinecke
2020-11-17 11:10 ` Paolo Bonzini
2020-12-17 10:07 ` [PATCH 0/7] scsi: scsi-disk corrupts data Paolo Bonzini
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=10dbdf68-20df-8517-e16b-f6c1baa4c8fc@redhat.com \
--to=pbonzini@redhat.com \
--cc=hare@suse.de \
--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).