TESTS: simple support for READDEFECTDATA10/12
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
49
lib/sync.c
49
lib/sync.c
@@ -614,6 +614,55 @@ iscsi_readcapacity16_sync(struct iscsi_context *iscsi, int lun)
|
||||
return state.task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_readdefectdata10_sync(struct iscsi_context *iscsi, int lun,
|
||||
int req_plist, int req_glist,
|
||||
int defect_list_format, uint16_t alloc_len)
|
||||
{
|
||||
struct iscsi_sync_state state;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
|
||||
if (iscsi_readdefectdata10_task(iscsi, lun,
|
||||
req_plist, req_glist,
|
||||
defect_list_format, alloc_len,
|
||||
scsi_sync_cb, &state) == NULL) {
|
||||
iscsi_set_error(iscsi,
|
||||
"Failed to send ReadDefectData10 command");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
event_loop(iscsi, &state);
|
||||
|
||||
return state.task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_readdefectdata12_sync(struct iscsi_context *iscsi, int lun,
|
||||
int req_plist, int req_glist,
|
||||
int defect_list_format,
|
||||
uint32_t address_descriptor_index,
|
||||
uint32_t alloc_len)
|
||||
{
|
||||
struct iscsi_sync_state state;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
|
||||
if (iscsi_readdefectdata12_task(iscsi, lun,
|
||||
req_plist, req_glist,
|
||||
defect_list_format,
|
||||
address_descriptor_index, alloc_len,
|
||||
scsi_sync_cb, &state) == NULL) {
|
||||
iscsi_set_error(iscsi,
|
||||
"Failed to send ReadDefectData12 command");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
event_loop(iscsi, &state);
|
||||
|
||||
return state.task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_sanitize_sync(struct iscsi_context *iscsi, int lun,
|
||||
int immed, int ause, int sa, int param_len,
|
||||
|
||||
Reference in New Issue
Block a user