示例#1
0
int
iscsi_task_mgmt_abort_task_async(struct iscsi_context *iscsi,
                                 struct scsi_task *task,
                                 iscsi_command_cb cb, void *private_data)
{
    iscsi_scsi_task_cancel(iscsi, task);

    return iscsi_task_mgmt_async(iscsi,
                                 task->lun, ISCSI_TM_ABORT_TASK,
                                 task->itt, task->cmdsn,
                                 cb, private_data);
}
示例#2
0
文件: iscsi.c 项目: breuerr/qemu
static void
iscsi_aio_cancel(BlockDriverAIOCB *blockacb)
{
    IscsiAIOCB *acb = (IscsiAIOCB *)blockacb;
    IscsiLun *iscsilun = acb->iscsilun;

    acb->common.cb(acb->common.opaque, -ECANCELED);
    acb->canceled = 1;

    /* send a task mgmt call to the target to cancel the task on the target */
    iscsi_task_mgmt_abort_task_async(iscsilun->iscsi, acb->task,
                                     iscsi_abort_task_cb, NULL);

    /* then also cancel the task locally in libiscsi */
    iscsi_scsi_task_cancel(iscsilun->iscsi, acb->task);
}