From: Dongli Zhang <dongli.zhang@oracle.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: fam@euphon.net, pbonzini@redhat.com, rui.loura@oracle.com,
joe.jin@oracle.com, adnan.misherfi@oracle.com
Subject: [PATCH 1/2] scsi/scsi_bus: use host_status as parameter for scsi_sense_from_host_status()
Date: Fri, 10 Dec 2021 06:16:14 -0800 [thread overview]
Message-ID: <20211210141615.2585-2-dongli.zhang@oracle.com> (raw)
In-Reply-To: <20211210141615.2585-1-dongli.zhang@oracle.com>
The scsi_sense_from_host_status() always returns GOOD since
req->host_status is 255 (-1) at this time. Change req->host_status to
host_status so that scsi_sense_from_host_status() will be able to return
the expected value.
Fixes: f3126d65b393("scsi: move host_status handling into SCSI drivers")
Cc: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
hw/scsi/scsi-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 77325d8cc7..d46650bd8c 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1465,7 +1465,7 @@ void scsi_req_complete_failed(SCSIRequest *req, int host_status)
assert(req->ops != &reqops_unit_attention);
if (!req->bus->info->fail) {
- status = scsi_sense_from_host_status(req->host_status, &sense);
+ status = scsi_sense_from_host_status(host_status, &sense);
if (status == CHECK_CONDITION) {
scsi_req_build_sense(req, sense);
}
--
2.17.1
next prev parent reply other threads:[~2021-12-10 14:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 14:16 [PATCH 0/2] scsi: to fix issue on passing host_status to the guest kernel Dongli Zhang
2021-12-10 14:16 ` Dongli Zhang [this message]
2021-12-10 14:16 ` [PATCH 2/2] scsi/utils: pass host_status = SCSI_HOST_ERROR to " Dongli Zhang
2022-01-11 1:15 ` [PATCH 0/2] scsi: to fix issue on passing host_status to the " Dongli Zhang
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=20211210141615.2585-2-dongli.zhang@oracle.com \
--to=dongli.zhang@oracle.com \
--cc=adnan.misherfi@oracle.com \
--cc=fam@euphon.net \
--cc=joe.jin@oracle.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rui.loura@oracle.com \
/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).