Add support for STARTSTOPUNIT command

This commit is contained in:
Ronnie Sahlberg
2012-07-15 08:10:39 +10:00
parent e6ca1451b0
commit 025136e81c
7 changed files with 120 additions and 0 deletions

View File

@@ -1168,6 +1168,30 @@ iscsi_modesense6_task(struct iscsi_context *iscsi, int lun, int dbd, int pc,
return task;
}
struct scsi_task *
iscsi_startstopunit_task(struct iscsi_context *iscsi, int lun,
int immed, int pcm, int pc,
int no_flush, int loej, int start,
iscsi_command_cb cb, void *private_data)
{
struct scsi_task *task;
task = scsi_cdb_startstopunit(immed, pcm, pc, no_flush,
loej, start);
if (task == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
"startstopunit cdb.");
return NULL;
}
if (iscsi_scsi_command_async(iscsi, lun, task, cb, NULL,
private_data) != 0) {
scsi_free_scsi_task(task);
return NULL;
}
return task;
}
struct scsi_task *
iscsi_synchronizecache10_task(struct iscsi_context *iscsi, int lun, int lba,
int num_blocks, int syncnv, int immed,