qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] scsi/scsi_bus: use host_status as parameter for scsi_sense_f


From: Dongli Zhang
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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]