From 71544d30a6f8b91574552a61cd5bd122a77e82d1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 25 Oct 2011 12:53:36 +0200 Subject: 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 Signed-off-by: Kevin Wolf --- hw/scsi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/scsi.h') diff --git a/hw/scsi.h b/hw/scsi.h index fcc345581d..ff8fdd0962 100644 --- a/hw/scsi.h +++ b/hw/scsi.h @@ -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); -- cgit v1.2.3