[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] scsi-block: Add qdev error properties
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2] scsi-block: Add qdev error properties |
Date: |
Fri, 18 Aug 2017 11:38:29 +0800 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Thu, 08/17 16:23, Paolo Bonzini wrote:
> > + if (scsi_sense_matches(r, SENSE_CODE(NO_MEDIUM))) {
> > + error = ENOMEDIUM;
> > + } else if (scsi_sense_matches(r, SENSE_CODE(TARGET_FAILURE))) {
> > + error = ENOMEM;
> > + } else if (scsi_sense_matches(r, SENSE_CODE(INVALID_FIELD))) {
> > + error = EINVAL;
> > + } else if (scsi_sense_matches(r, SENSE_CODE(SPACE_ALLOC_FAILED))) {
> > + error = ENOSPC;
> > + } else {
> > + error = EIO;
>
> Nice touch :) and in fact the ENOSPC case is needed for correctness.
>
Offline you mentioned iscsi_translate_sense(). Makes sense to unify both. We can
create a util/scsi.c to move it there.
About the error/non-error condition, is it enough to add a check "status ==
CHECK_CONDITION"?
Fam