aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-28 09:48:00 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-30 13:30:51 +0200
commit8e0a9320e94930fd6e5c2906c478203b80392f5c (patch)
tree73d7bfb2fc1b5c0b1e5ec233fc5b64289a1edad3 /include/hw
parentd5776465ee9a55815792efa34d79de240f4ffd99 (diff)
scsi: Introduce scsi_req_cancel_async
Devices will call this function to start an asynchronous cancellation. The bus->info->cancel will be called after the request is canceled. Devices will probably need to track a separate TMF request that triggers this cancellation, and wait until the cancellation is done before completing it. So we store a notifier list in SCSIRequest and in scsi_req_cancel_complete we notify them. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/scsi/scsi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
index 2127a335ba..b61bedb28c 100644
--- a/include/hw/scsi/scsi.h
+++ b/include/hw/scsi/scsi.h
@@ -5,6 +5,7 @@
#include "block/block.h"
#include "hw/block/block.h"
#include "sysemu/sysemu.h"
+#include "qemu/notify.h"
#define MAX_SCSI_DEVS 255
@@ -53,6 +54,7 @@ struct SCSIRequest {
void *hba_private;
size_t resid;
SCSICommand cmd;
+ NotifierList cancel_notifiers;
/* Note:
* - fields before sense are initialized by scsi_req_alloc;
@@ -266,6 +268,7 @@ 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);
void scsi_req_cancel(SCSIRequest *req);
+void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier);
void scsi_req_retry(SCSIRequest *req);
void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense);
void scsi_device_set_ua(SCSIDevice *sdev, SCSISense sense);