qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] scsi-block: Add qdev error properties
Date: Fri, 18 Aug 2017 11:38:29 +0800	[thread overview]
Message-ID: <20170818033829.GA15392@lemon> (raw)
In-Reply-To: <dad88591-da0d-d9dd-ef0d-4153bbc68b85@redhat.com>

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

  reply	other threads:[~2017-08-18  3:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 14:11 [Qemu-devel] [PATCH v2] scsi-block: Add qdev error properties Fam Zheng
2017-08-17 14:23 ` Paolo Bonzini
2017-08-18  3:38   ` Fam Zheng [this message]
2017-08-18  6:41     ` Paolo Bonzini
2017-08-18 13:21       ` Fam Zheng

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=20170818033829.GA15392@lemon \
    --to=famz@redhat.com \
    --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).