iscsi-test: do not test DPO/FUA for non-SBC devices

These bits are not defined in MMC.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini
2012-08-30 16:59:35 +02:00
parent 560241b494
commit 418058e52a
6 changed files with 114 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ int T0104_read10_flags(const char *initiator, const char *url, int data_loss _U_
{
struct iscsi_context *iscsi;
struct scsi_task *task;
struct scsi_inquiry_standard *inq;
int ret, lun;
printf("0104_read10_flags:\n");
@@ -50,6 +51,24 @@ int T0104_read10_flags(const char *initiator, const char *url, int data_loss _U_
ret = 0;
/* This test is only valid for SBC devices */
task = iscsi_inquiry_sync(iscsi, lun, 0, 0, 64);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
printf("Inquiry command failed : %s\n", iscsi_get_error(iscsi));
return -1;
}
inq = scsi_datain_unmarshall(task);
if (inq == NULL) {
printf("failed to unmarshall inquiry datain blob\n");
scsi_free_scsi_task(task);
return -1;
}
if (inq->periperal_device_type != SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_DIRECT_ACCESS) {
printf("LUN is not SBC device. Skipping test\n");
scsi_free_scsi_task(task);
return -1;
}
/* Try out DPO : 1 */
printf("Read10 with DPO==1 ... ");