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>
This commit is contained in:
Fam Zheng 2014-09-30 11:40:23 +08:00 committed by Paolo Bonzini
parent 8e0a9320e9
commit 49e7e31aa0
2 changed files with 64 additions and 9 deletions

View file

@ -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;