sahlberg / libiscsi

iscsi client library and utilities
Other
192 stars 165 forks source link

checking if task is in outqueue #398

Closed anatoliy-glagolev closed 1 year ago

anatoliy-glagolev commented 1 year ago

Libiscsi users need a way to check if a task is queued to send (not sent yet) before invoking functions such as iscsi_task_mgmt_abort_task_async. Otherwise, because task management requests are automatically treated as "immediate", a request to abort a task is sent before the task itself.

if (iscsi_scsi_is_task_inoutqueue(iscsi, task_)) { iscsi_scsi_canceltask(iscsi, task_); } else { iscsi_task_mgmt_abort_taskasync(iscsi, task, AbortCb, context); }