Libiscsi: add support for RECEIVE COPY RESULTS

Build on existing scsi_cdb_receive_copy_results() functionality. This
request is most commonly used to determine target-side EXTENDED COPY
operational parameters.

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2017-01-03 19:33:01 +01:00
parent 2b9abd9ac8
commit f475436c5a
5 changed files with 56 additions and 0 deletions

View File

@@ -1667,6 +1667,26 @@ iscsi_report_supported_opcodes_sync(struct iscsi_context *iscsi, int lun,
return state.task;
}
struct scsi_task *
iscsi_receive_copy_results_sync(struct iscsi_context *iscsi, int lun,
int sa, int list_id, int alloc_len)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_receive_copy_results_task(iscsi, lun, sa, list_id, alloc_len,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi, "Failed to send RECEIVE COPY RESULTS"
" command");
return NULL;
}
event_loop(iscsi, &state);
return state.task;
}
struct scsi_task *
iscsi_scsi_command_sync(struct iscsi_context *iscsi, int lun,
struct scsi_task *task, struct iscsi_data *data)