mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
scsi: move host_status handling into SCSI drivers
Some SCSI drivers like virtio have an internal mapping for the host_status. This patch moves the host_status translation into the SCSI drivers to allow those drivers to set up the correct values. Signed-off-by: Hannes Reinecke <hare@suse.de>. [Added default handling to avoid touching all drivers. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a108557bbf
commit
f3126d65b3
6 changed files with 128 additions and 13 deletions
|
@ -89,10 +89,8 @@ static void scsi_command_complete_noio(SCSIGenericReq *r, int ret)
|
|||
scsi_req_build_sense(&r->req, sense);
|
||||
}
|
||||
} else if (io_hdr->host_status != SCSI_HOST_OK) {
|
||||
status = scsi_sense_from_host_status(io_hdr->host_status, &sense);
|
||||
if (status == CHECK_CONDITION) {
|
||||
scsi_req_build_sense(&r->req, sense);
|
||||
}
|
||||
scsi_req_complete_failed(&r->req, io_hdr->host_status);
|
||||
goto done;
|
||||
} else if (io_hdr->driver_status & SG_ERR_DRIVER_TIMEOUT) {
|
||||
status = BUSY;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue