diff options
author | Hannes Reinecke <hare@suse.de> | 2021-02-24 19:14:50 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-06 11:42:57 +0100 |
commit | f3126d65b393c015e8f87763fdccee99bb1119af (patch) | |
tree | 55e3593634cbaadde5e1a74f7c2d0e43c8001dd1 /include/hw/scsi | |
parent | a108557bbff8a3f44233982f015f996426411be8 (diff) | |
download | qemu-f3126d65b393c015e8f87763fdccee99bb1119af.zip qemu-f3126d65b393c015e8f87763fdccee99bb1119af.tar.gz qemu-f3126d65b393c015e8f87763fdccee99bb1119af.tar.bz2 |
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>
Diffstat (limited to 'include/hw/scsi')
-rw-r--r-- | include/hw/scsi/scsi.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 5d992e6..0b726bc 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -27,7 +27,8 @@ struct SCSIRequest { uint32_t refcount; uint32_t tag; uint32_t lun; - uint32_t status; + int16_t status; + int16_t host_status; void *hba_private; size_t resid; SCSICommand cmd; @@ -123,6 +124,7 @@ struct SCSIBusInfo { int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, void *hba_private); void (*transfer_data)(SCSIRequest *req, uint32_t arg); + void (*fail)(SCSIRequest *req); void (*complete)(SCSIRequest *req, size_t resid); void (*cancel)(SCSIRequest *req); void (*change)(SCSIBus *bus, SCSIDevice *dev, SCSISense sense); @@ -177,6 +179,7 @@ void scsi_req_print(SCSIRequest *req); void scsi_req_continue(SCSIRequest *req); void scsi_req_data(SCSIRequest *req, int len); void scsi_req_complete(SCSIRequest *req, int status); +void scsi_req_complete_failed(SCSIRequest *req, int host_status); uint8_t *scsi_req_get_buf(SCSIRequest *req); int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len); void scsi_req_cancel_complete(SCSIRequest *req); |