@@ -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
@@ -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,
@@ -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);