diff mbox series

[1/2] scsi/scsi_bus: use host_status as parameter for scsi_sense_from_host_status()

Message ID 20211210141615.2585-2-dongli.zhang@oracle.com (mailing list archive)
State New, archived
Headers show
Series scsi: to fix issue on passing host_status to the guest kernel | expand

Commit Message

Dongli Zhang Dec. 10, 2021, 2:16 p.m. UTC
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 mbox series

Patch

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);
         }