diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-10-25 12:53:36 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-10-28 19:25:52 +0200 |
commit | 71544d30a6f8b91574552a61cd5bd122a77e82d1 (patch) | |
tree | 7c39af913f1105f9561b75895873b69d72e6b4bb /hw/scsi.h | |
parent | c9501c951c3dbe007dfba9328156be2d931f6d94 (diff) |
scsi: push request restart to SCSIDevice
The request restart mechanism is generic and could be reused for
scsi-generic. In the meanwhile, pushing it to SCSIDevice avoids
that scsi_dma_restart_bh looks at SCSIGenericReqs when working on
a scsi-block device.
The code is the same that is already in hw/scsi-disk.c, with
the type flags replaced by req->cmd.mode and a more generic way to
requeue SCSI_XFER_NONE commands.
I also added a missing call to qemu_del_vm_change_state_handler.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r-- | hw/scsi.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include "qdev.h" #include "block.h" +#include "sysemu.h" #define MAX_SCSI_DEVS 255 @@ -52,6 +53,7 @@ struct SCSIRequest { uint32_t sense_len; bool enqueued; bool io_canceled; + bool retry; void *hba_private; QTAILQ_ENTRY(SCSIRequest) next; }; @@ -59,6 +61,8 @@ struct SCSIRequest { struct SCSIDevice { DeviceState qdev; + VMChangeStateEntry *vmsentry; + QEMUBH *bh; uint32_t id; BlockConf conf; SCSIDeviceInfo *info; @@ -194,6 +198,7 @@ uint8_t *scsi_req_get_buf(SCSIRequest *req); int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len); void scsi_req_abort(SCSIRequest *req, int status); void scsi_req_cancel(SCSIRequest *req); +void scsi_req_retry(SCSIRequest *req); void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense); int scsi_device_get_sense(SCSIDevice *dev, uint8_t *buf, int len, bool fixed); SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int target, int lun); |