summary refs log tree commit diff stats
path: root/include
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-30 11:40:23 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-30 13:30:51 +0200
commit49e7e31aa00a9fb466203de19120fe5c4459cac0 (patch)
treea1d711c93218beb0f3f3681d33b15959bec1699a /include
parent8e0a9320e94930fd6e5c2906c478203b80392f5c (diff)
downloadfocaccia-qemu-49e7e31aa00a9fb466203de19120fe5c4459cac0.tar.gz
focaccia-qemu-49e7e31aa00a9fb466203de19120fe5c4459cac0.zip
virtio-scsi: Handle TMF request cancellation asynchronously
For VIRTIO_SCSI_T_TMF_ABORT_TASK and VIRTIO_SCSI_T_TMF_ABORT_TASK_SET,
use scsi_req_cancel_async to start the cancellation.

Because each tmf command may cancel multiple requests, we need to use a
counter to track the number of remaining requests we still need to wait
for.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/virtio-scsi.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 60dbfc99a8..d6e5e7935c 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -214,8 +214,13 @@ typedef struct VirtIOSCSIReq {
     /* Set by dataplane code. */
     VirtIOSCSIVring *vring;
 
-    /* Used for two-stage request submission */
-    QTAILQ_ENTRY(VirtIOSCSIReq) next;
+    union {
+        /* Used for two-stage request submission */
+        QTAILQ_ENTRY(VirtIOSCSIReq) next;
+
+        /* Used for cancellation of request during TMFs */
+        int remaining;
+    };
 
     SCSIRequest *sreq;
     size_t resp_size;