int iscsi_task_mgmt_target_cold_reset_async(struct iscsi_context *iscsi, iscsi_command_cb cb, void *private_data) { return iscsi_task_mgmt_async(iscsi, 0, ISCSI_TM_TARGET_COLD_RESET, 0xffffffff, 0, cb, private_data); }
int iscsi_task_mgmt_abort_task_async(struct iscsi_context *iscsi, struct scsi_task *task, iscsi_command_cb cb, void *private_data) { return iscsi_task_mgmt_async(iscsi, task->lun, ISCSI_TM_ABORT_TASK, task->itt, task->cmdsn, cb, private_data); }
int iscsi_task_mgmt_lun_reset_async(struct iscsi_context *iscsi, uint32_t lun, iscsi_command_cb cb, void *private_data) { return iscsi_task_mgmt_async(iscsi, lun, ISCSI_TM_LUN_RESET, 0xffffffff, 0, cb, private_data); }
int iscsi_task_mgmt_abort_task_set_async(struct iscsi_context *iscsi, uint32_t lun, iscsi_command_cb cb, void *private_data) { return iscsi_task_mgmt_async(iscsi, lun, ISCSI_TM_ABORT_TASK_SET, 0xffffffff, 0, cb, private_data); }
int iscsi_task_mgmt_target_warm_reset_async(struct iscsi_context *iscsi, iscsi_command_cb cb, void *private_data) { iscsi_scsi_cancel_all_tasks(iscsi); return iscsi_task_mgmt_async(iscsi, 0, ISCSI_TM_TARGET_WARM_RESET, 0xffffffff, 0, cb, private_data); }
void iSCSILibWrapper::iSCSILUNReset(uint32_t lun) { // Remove us from the background thread iSCSIBackGround::GetInstance().RemoveConnection(*this); if (!mClient.connected || mClient.error) { if (mClient.error) mErrorString.Format("%s: previous error prevents sending LUN reset to target %s: %s", __func__, mTarget.c_str(), iscsi_get_error(mIscsi)); else mErrorString.Format("%s: Sending LUN reset to target %s not possible without a connection!", __func__, mTarget.c_str()); mError = true; throw CException(mErrorString); } mClient.finished = 0; if (iscsi_task_mgmt_async(mIscsi, lun, ISCSI_TM_LUN_RESET, 0xffffffff, 0, lun_reset_cb, this)) { EString estr; estr.Format("%s: Error executing SCSI request: %s", __func__, iscsi_get_error(mIscsi)); mError = true; throw CException(mErrorString); } ServiceISCSIEvents(); // Add to the background task iSCSIBackGround::GetInstance().AddConnection(*this); }