test/multipath: add helper to check that all paths are iSCSI
MPATH_SKIP_UNLESS_ISCSI(_sds, _num_sds) iterates over all _sds, and skips the test unless all paths are iSCSI based. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -369,3 +369,19 @@ mpath_check_matching_ids(int num_sds,
|
||||
ret = mpath_check_matching_ids_serial_vpd(num_sds, sds);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
mpath_count_iscsi(int num_sds,
|
||||
struct scsi_device **sds)
|
||||
{
|
||||
int i;
|
||||
int found = 0;
|
||||
|
||||
for (i = 0; i < num_sds; i++) {
|
||||
if (sds[i]->iscsi_ctx != NULL) {
|
||||
found++;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user