test: add multipath helper functions

mpath_check_matching_ids() walks the list of scsi devices, and confirms
that all entries share one common device identification designator or
unit serial number.

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2015-05-26 15:19:29 +02:00
parent 0630aa5ef0
commit a291c2b308
3 changed files with 399 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*
iscsi test-tool multipath support
Copyright (C) 2015 David Disseldorp
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ISCSI_MULTIPATH_H_
#define _ISCSI_MULTIPATH_H_
#define MPATH_MAX_DEVS 2
extern int mp_num_sds;
extern struct scsi_device *mp_sds[MPATH_MAX_DEVS];
int
mpath_check_matching_ids(int num_sds,
struct scsi_device **sds);
#endif /* _ISCSI_MULTIPATH_H_ */