diff mbox

multipath-tools ./multipath.conf.defaults libm ...

Message ID 20100824215111.17381.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org Aug. 24, 2010, 9:51 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/multipath.conf.defaults	2010/08/09 21:35:58	1.5.4.22
+++ multipath-tools/multipath.conf.defaults	2010/08/24 21:51:10	1.5.4.23
@@ -267,7 +267,7 @@ 
 #               vendor                  "HITACHI"
 #               product                 "DF.*"
 #		getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
-#		prio_callout		"/sbin/mpath_prio_hds_modular %d"
+#		prio_callout		"/sbin/mpath_prio_hds_modular /dev/%n"
 #		features		"0"
 #		hardware_handler	"0"
 #		path_grouping_policy	group_by_prio
@@ -395,7 +395,7 @@ 
 #		vendor			"IBM"
 #		product			"1750500"
 #		getuid_callout		"/sbin/scsi_id -g -u -s /block/%n"
-#               prio_callout            "/sbin/mpath_prio_alua %d"	
+#               prio_callout            "/sbin/mpath_prio_alua /dev/%n"
 #		features		"1 queue_if_no_path"
 #		hardware_handler	"0"
 #               path_grouping_policy    group_by_prio
@@ -482,7 +482,7 @@ 
 #		vendor			"Pillar"
 #		product			"Axiom [35]00"
 #		getuid_callout		"/sbin/scsi_id -g -u -s /block/%n"
-#               prio_callout            "/sbin/mpath_prio_alua %d"	
+#               prio_callout            "/sbin/mpath_prio_alua /dev/%n"
 #		features		"0"
 #		hardware_handler	"0"
 #               path_grouping_policy    group_by_prio
--- multipath-tools/libmultipath/hwtable.c	2010/08/09 21:35:58	1.20.2.29
+++ multipath-tools/libmultipath/hwtable.c	2010/08/24 21:51:10	1.20.2.30
@@ -289,7 +289,7 @@ 
 		.vendor        = "HITACHI",
 		.product       = "DF.*",
 		.getuid        = DEFAULT_GETUID,
-		.getprio       = "/sbin/mpath_prio_hds_modular %d",
+		.getprio       = "/sbin/mpath_prio_hds_modular /dev/%n",
 		.features      = DEFAULT_FEATURES,
 		.hwhandler     = DEFAULT_HWHANDLER,
 		.selector      = DEFAULT_SELECTOR,
@@ -646,7 +646,7 @@ 
 		.vendor        = "Pillar",
 		.product       = "Axiom [35]00",
 		.getuid        = DEFAULT_GETUID,
-		.getprio       = "/sbin/mpath_prio_alua %d",
+		.getprio       = "/sbin/mpath_prio_alua /dev/%n",
 		.features      = DEFAULT_FEATURES,
 		.hwhandler     = DEFAULT_HWHANDLER,
 		.selector      = DEFAULT_SELECTOR,
--- multipath-tools/path_priority/pp_hds_modular/pp_hds_modular.c	2006/06/06 18:32:44	1.2
+++ multipath-tools/path_priority/pp_hds_modular/pp_hds_modular.c	2010/08/24 21:51:10	1.2.2.1
@@ -99,7 +99,7 @@ 
 
 int verbose;
 
-int hds_modular_prio(char * major_minor)
+int hds_modular_prio(char * device)
 {
 	int sg_fd, k, i;
 	char vendor[32];
@@ -117,16 +117,24 @@ 
 	unsigned char sense_buffer[32];
 	sg_io_hdr_t io_hdr;
 
-	sscanf(major_minor, "%u:%u", &major, &minor);
 	memset(devpath, 0, FILE_NAME_SIZE);
+	if (sscanf(device, "%u:%u", &major, &minor) == 2) {
 
-	if (safe_sprintf(devpath, "/tmp/.pp_balance.%u.%u.devnode",
-			 major, minor))
-		exit(1);
-
-	unlink (devpath);
-	mknod(devpath, S_IFBLK|S_IRUSR|S_IWUSR, makedev(major, minor));
+		if (safe_sprintf(devpath, "/tmp/.pp_balance.%u.%u.devnode",
+				 major, minor))
+			exit(1);
 
+		unlink (devpath);
+		mknod(devpath, S_IFBLK|S_IRUSR|S_IWUSR, makedev(major, minor));
+	}
+	else if (device[0] == '/') {
+		if (safe_sprintf(devpath, "%s", device))
+			exit(1);
+	}
+	else {
+		if (safe_sprintf(devpath, "/dev/%s", device))
+			exit(1);
+	}
 	if ((sg_fd = open(devpath, O_RDONLY)) < 0) exit(1);
 	if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000))
 		exit(1);