|
From: | Paolo Bonzini |
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 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 |
On 16/11/20 20:03, Hannes Reinecke wrote:
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.+ 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 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
[Prev in Thread] | Current Thread | [Next in Thread] |