Prioritizers enhancement
authorChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 21 May 2010 14:41:30 +0000 (16:41 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 21 May 2010 14:41:30 +0000 (16:41 +0200)
1/ add the 'prio_args' config keyword to allow passing arguments
   to the getprio function

2/ merge the datacore prioritizer. Adapt the legacy datacore
   prioritizer callout to the libprio framework. First use of the
   'prio_args'

3/ fix the 'show config' multipathd cli command to display the
   prio and prio_args values. Also fix a bunch of other values
   affected by the same bug (features, ...).

4/ update docs

5/ remove some heading whitespaces

6/ remove useless prioritizers include files

27 files changed:
libmultipath/config.c
libmultipath/config.h
libmultipath/dict.c
libmultipath/hwtable.c
libmultipath/prio.c
libmultipath/prio.h
libmultipath/prioritizers/Makefile
libmultipath/prioritizers/alua.c
libmultipath/prioritizers/const.c
libmultipath/prioritizers/const.h [deleted file]
libmultipath/prioritizers/datacore.c [new file with mode: 0644]
libmultipath/prioritizers/emc.c
libmultipath/prioritizers/emc.h [deleted file]
libmultipath/prioritizers/hds.c
libmultipath/prioritizers/hds.h [deleted file]
libmultipath/prioritizers/hp_sw.c
libmultipath/prioritizers/hp_sw.h [deleted file]
libmultipath/prioritizers/netapp.c
libmultipath/prioritizers/netapp.h [deleted file]
libmultipath/prioritizers/random.c
libmultipath/prioritizers/random.h [deleted file]
libmultipath/prioritizers/rdac.c
libmultipath/prioritizers/rdac.h [deleted file]
libmultipath/propsel.c
libmultipath/version.h
multipath.conf.annotated
multipath.conf.defaults

index fbe2125..a4178be 100644 (file)
@@ -155,6 +155,9 @@ free_hwe (struct hwentry * hwe)
        if (hwe->prio_name)
                FREE(hwe->prio_name);
 
+       if (hwe->prio_args)
+               FREE(hwe->prio_args);
+
        if (hwe->bl_product)
                FREE(hwe->bl_product);
 
@@ -278,6 +281,7 @@ merge_hwe (struct hwentry * hwe1, struct hwentry * hwe2)
        merge_str(selector);
        merge_str(checker_name);
        merge_str(prio_name);
+       merge_str(prio_args);
        merge_str(bl_product);
        merge_num(pgpolicy);
        merge_num(pgfailback);
@@ -322,10 +326,13 @@ store_hwe (vector hwtable, struct hwentry * dhwe)
 
        if (dhwe->checker_name && !(hwe->checker_name = set_param_str(dhwe->checker_name)))
                goto out;
-                               
+
        if (dhwe->prio_name && !(hwe->prio_name = set_param_str(dhwe->prio_name)))
                goto out;
-                               
+
+       if (dhwe->prio_args && !(hwe->prio_args = set_param_str(dhwe->prio_args)))
+               goto out;
+
        hwe->pgpolicy = dhwe->pgpolicy;
        hwe->pgfailback = dhwe->pgfailback;
        hwe->rr_weight = dhwe->rr_weight;
@@ -402,6 +409,9 @@ free_config (struct config * conf)
        if (conf->prio_name)
                FREE(conf->prio_name);
 
+       if (conf->prio_args)
+               FREE(conf->prio_args);
+
        if (conf->checker_name)
                FREE(conf->checker_name);
 
index d8e6915..471eed0 100644 (file)
@@ -24,6 +24,7 @@ struct hwentry {
        char * selector;
        char * checker_name;
        char * prio_name;
+       char * prio_args;
 
        int pgpolicy;
        int pgfailback;
@@ -96,6 +97,7 @@ struct config {
        char * hwhandler;
        char * bindings_file;
        char * prio_name;
+       char * prio_args;
        char * checker_name;
 
        vector keywords;
index ab0c831..02aa238 100644 (file)
@@ -147,6 +147,17 @@ def_prio_handler(vector strvec)
        return 0;
 }
 
+static int
+def_prio_args_handler(vector strvec)
+{
+       conf->prio_args = set_value(strvec);
+
+       if (!conf->prio_args)
+               return 1;
+
+       return 0;
+}
+
 static int
 def_features_handler(vector strvec)
 {
@@ -165,7 +176,7 @@ def_path_checker_handler(vector strvec)
 
        if (!conf->checker_name)
                return 1;
-       
+
        return 0;
 }
 
@@ -767,7 +778,7 @@ hw_path_checker_handler(vector strvec)
 
        if (!hwe->checker_name)
                return 1;
-       
+
        return 0;
 }
 
@@ -819,6 +830,22 @@ hw_prio_handler(vector strvec)
        return 0;
 }
 
+static int
+hw_prio_args_handler(vector strvec)
+{
+       struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
+
+       if (!hwe)
+               return 1;
+
+       hwe->prio_args = set_value(strvec);
+
+       if (!hwe->prio_args)
+               return 1;
+
+       return 0;
+}
+
 static int
 hw_failback_handler(vector strvec)
 {
@@ -1529,9 +1556,10 @@ snprint_hw_getuid_callout (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->getuid || !conf->getuid)
+       if (!hwe->getuid)
                return 0;
-       if (strlen(hwe->getuid) == strlen(conf->getuid) &&
+       if (conf->getuid &&
+           strlen(hwe->getuid) == strlen(conf->getuid) &&
            !strcmp(hwe->getuid, conf->getuid))
                return 0;
 
@@ -1543,22 +1571,36 @@ snprint_hw_prio (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->prio_name || !conf->prio_name)
+       if (!hwe->prio_name || (strlen(hwe->prio_name) == 0))
                return 0;
-       if (!strcmp(hwe->prio_name, conf->prio_name))
+       if (conf->prio_name && !strcmp(hwe->prio_name, conf->prio_name))
                return 0;
-       
+
        return snprintf(buff, len, "%s", hwe->prio_name);
 }
 
+static int
+snprint_hw_prio_args (char * buff, int len, void * data)
+{
+       struct hwentry * hwe = (struct hwentry *)data;
+
+        if (!hwe->prio_args || (strlen(hwe->prio_args) == 0))
+                return 0;
+        if (conf->prio_args && !strcmp(hwe->prio_args, conf->prio_args))
+                return 0;
+
+       return snprintf(buff, len, "%s", hwe->prio_args);
+}
+
 static int
 snprint_hw_features (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->features || !conf->features)
+       if (!hwe->features)
                return 0;
-       if (strlen(hwe->features) == strlen(conf->features) &&
+       if (conf->features &&
+           strlen(hwe->features) == strlen(conf->features) &&
            !strcmp(hwe->features, conf->features))
                return 0;
 
@@ -1570,9 +1612,10 @@ snprint_hw_hardware_handler (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->hwhandler || !conf->hwhandler)
+       if (!hwe->hwhandler)
                return 0;
-       if (strlen(hwe->hwhandler) == strlen(conf->hwhandler) &&
+       if (conf->hwhandler &&
+           strlen(hwe->hwhandler) == strlen(conf->hwhandler) &&
            !strcmp(hwe->hwhandler, conf->hwhandler))
                return 0;
 
@@ -1584,9 +1627,10 @@ snprint_hw_selector (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->selector || !conf->selector)
+       if (!hwe->selector)
                return 0;
-       if (strlen(hwe->selector) == strlen(conf->selector) &&
+       if (conf->selector &&
+           strlen(hwe->selector) == strlen(conf->selector) &&
            !strcmp(hwe->selector, conf->selector))
                return 0;
 
@@ -1600,9 +1644,9 @@ snprint_hw_path_grouping_policy (char * buff, int len, void * data)
 
        char str[POLICY_NAME_SIZE];
 
-       if (!hwe->pgpolicy || !conf->pgpolicy)
+       if (!hwe->pgpolicy)
                return 0;
-       if (hwe->pgpolicy == conf->pgpolicy)
+       if (conf->pgpolicy && hwe->pgpolicy == conf->pgpolicy)
                return 0;
 
        get_pgpolicy_name(str, POLICY_NAME_SIZE, hwe->pgpolicy);
@@ -1615,9 +1659,9 @@ snprint_hw_failback (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->pgfailback || !conf->pgfailback)
+       if (!hwe->pgfailback)
                return 0;
-       if (hwe->pgfailback == conf->pgfailback)
+       if (conf->pgfailback && hwe->pgfailback == conf->pgfailback)
                return 0;
 
        switch(hwe->pgfailback) {
@@ -1638,9 +1682,9 @@ snprint_hw_rr_weight (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->rr_weight || !conf->rr_weight)
+       if (!hwe->rr_weight)
                return 0;
-       if (hwe->rr_weight == conf->rr_weight)
+       if (conf->rr_weight && hwe->rr_weight == conf->rr_weight)
                return 0;
        if (hwe->rr_weight == RR_WEIGHT_PRIO)
                return snprintf(buff, len, "priorities");
@@ -1725,11 +1769,12 @@ snprint_hw_path_checker (char * buff, int len, void * data)
 {
        struct hwentry * hwe = (struct hwentry *)data;
 
-       if (!hwe->checker_name || !conf->checker_name)
+       if (!hwe->checker_name)
                return 0;
-       if (!strcmp(hwe->checker_name, conf->checker_name))
+       if (conf->checker_name &&
+           !strcmp(hwe->checker_name, conf->checker_name))
                return 0;
-       
+
        return snprintf(buff, len, "%s", hwe->checker_name);
 }
 
@@ -1839,10 +1884,23 @@ snprint_def_prio (char * buff, int len, void * data)
        if (strlen(conf->prio_name) == strlen(DEFAULT_PRIO) &&
            !strcmp(conf->prio_name, DEFAULT_PRIO))
                return 0;
-       
+
        return snprintf(buff, len, "%s", conf->prio_name);
 }
 
+static int
+snprint_def_prio_args (char * buff, int len, void * data)
+{
+       if (!conf->prio_args)
+               return 0;
+
+       if (strlen(conf->prio_args) == strlen(DEFAULT_PRIO_ARGS) &&
+           !strcmp(conf->prio_args, DEFAULT_PRIO_ARGS))
+               return 0;
+
+       return snprintf(buff, len, "%s", conf->prio_args);
+}
+
 static int
 snprint_def_features (char * buff, int len, void * data)
 {
@@ -1863,7 +1921,7 @@ snprint_def_path_checker (char * buff, int len, void * data)
        if (strlen(conf->checker_name) == strlen(DEFAULT_CHECKER) &&
            !strcmp(conf->checker_name, DEFAULT_CHECKER))
                return 0;
-       
+
        return snprintf(buff, len, "%s", conf->checker_name);
 }
 
@@ -2055,6 +2113,7 @@ init_keywords(void)
        install_keyword("path_grouping_policy", &def_pgpolicy_handler, &snprint_def_path_grouping_policy);
        install_keyword("getuid_callout", &def_getuid_callout_handler, &snprint_def_getuid_callout);
        install_keyword("prio", &def_prio_handler, &snprint_def_prio);
+       install_keyword("prio_args", &def_prio_args_handler, &snprint_def_prio_args);
        install_keyword("features", &def_features_handler, &snprint_def_features);
        install_keyword("path_checker", &def_path_checker_handler, &snprint_def_path_checker);
        install_keyword("checker", &def_path_checker_handler, &snprint_def_path_checker);
@@ -2120,6 +2179,7 @@ init_keywords(void)
        install_keyword("features", &hw_features_handler, &snprint_hw_features);
        install_keyword("hardware_handler", &hw_handler_handler, &snprint_hw_hardware_handler);
        install_keyword("prio", &hw_prio_handler, &snprint_hw_prio);
+       install_keyword("prio_args", &hw_prio_args_handler, &snprint_hw_prio_args);
        install_keyword("failback", &hw_failback_handler, &snprint_hw_failback);
        install_keyword("rr_weight", &hw_weight_handler, &snprint_hw_rr_weight);
        install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
index 6406c2d..e4fe380 100644 (file)
@@ -37,6 +37,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * Apple controller family
@@ -58,6 +59,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DEFAULT_CHECKER,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * StorageWorks controller family
@@ -79,6 +81,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DEFAULT_CHECKER,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "DEC",
@@ -94,6 +97,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = HP_SW,
                .prio_name     = PRIO_HP_SW,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "HP",
@@ -109,6 +113,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* MSA 1000/MSA1500 EVA 3000/5000 with old firmware */
@@ -125,6 +130,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = HP_SW,
                .prio_name     = PRIO_HP_SW,
+               .prio_args     = NULL,
        },
        {
                /* MSA 1000/1500 with new firmware */
@@ -141,6 +147,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        {
                /* EVA 3000/5000 with new firmware, EVA 4000/6000/8000 */
@@ -157,6 +164,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        {
                /* HP MSA2000 product family with old firmware */
@@ -173,6 +181,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* HP MSA2000 product family with new firmware */
@@ -189,6 +198,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
 
        {
@@ -206,6 +216,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
 
        {
@@ -223,6 +234,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = CCISS_TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * DDN controller family
@@ -244,6 +256,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * EMC / Clariion controller family
@@ -265,6 +278,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "DGC",
@@ -281,6 +295,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = EMC_CLARIION,
                .prio_name     = PRIO_EMC,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "EMC",
@@ -296,6 +311,7 @@ static struct hwentry default_hw[] = {
                .no_path_retry = 5,
                .minio         = DEFAULT_MINIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * Fujitsu controller family
@@ -317,6 +333,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "EMC",
@@ -333,6 +350,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * Hitachi controller family
@@ -354,6 +372,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "HITACHI",
@@ -369,6 +388,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_HDS,
+               .prio_args     = NULL,
        },
        /*
         * IBM controller family
@@ -390,6 +410,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM FAStT 1722-600 */
@@ -406,6 +427,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS4100 */
@@ -422,6 +444,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS3200 / DS3300 / DS3400 */
@@ -438,6 +461,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS4400 / DS4500 / FAStT700 */
@@ -454,6 +478,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "IBM",
@@ -469,6 +494,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
            /* IBM DS4700 */
@@ -485,6 +511,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
            /* IBM DS4800 */
@@ -501,6 +528,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
            /* IBM DS5000 */
@@ -517,6 +545,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* IBM Netfinity Fibre Channel RAID Controller Unit */
@@ -533,6 +562,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS4200 / FAStT200 */
@@ -549,6 +579,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM ESS F20 aka Shark */
@@ -565,6 +596,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM ESS F20 aka Shark */
@@ -581,6 +613,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS6000 */
@@ -597,6 +630,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        {
                /* IBM DS8000 */
@@ -613,6 +647,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM SAN Volume Controller */
@@ -629,6 +664,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        {
                /* IBM S/390 ECKD DASD */
@@ -646,6 +682,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM S/390 FBA DASD */
@@ -663,6 +700,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM IPR */
@@ -679,6 +717,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        /*
         * IBM Power Virtual SCSI Devices
@@ -701,6 +740,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                /* IBM 3303      NVDISK */
@@ -717,6 +757,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
 
        {
@@ -734,6 +775,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* DELL MD3000i */
@@ -750,6 +792,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* DELL MD32xx */
@@ -766,6 +809,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                /* DELL MD32xxi */
@@ -782,6 +826,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /*
         * NETAPP controller family
@@ -803,6 +848,7 @@ static struct hwentry default_hw[] = {
                .minio         = 128,
                .checker_name  = DIRECTIO,
                .prio_name     = PRIO_NETAPP,
+               .prio_args     = NULL,
        },
        /*
         * NEXENTA/COMSTAR controller family
@@ -824,6 +870,7 @@ static struct hwentry default_hw[] = {
                .minio         = 128,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * IBM NSeries (NETAPP) controller family
@@ -845,6 +892,7 @@ static struct hwentry default_hw[] = {
                .minio         = 128,
                .checker_name  = DIRECTIO,
                .prio_name     = PRIO_NETAPP,
+               .prio_args     = NULL,
        },
        /*
         * Pillar Data controller family
@@ -866,6 +914,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_ALUA,
+               .prio_args     = NULL,
        },
        /*
         * SGI arrays
@@ -887,6 +936,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "SGI",
@@ -902,6 +952,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "SGI",
@@ -917,6 +968,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /*
         * STK arrays
@@ -938,6 +990,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = TUR,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /*
         * SUN arrays
@@ -959,6 +1012,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = DIRECTIO,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        /*
         * Pivot3 RAIGE
@@ -980,6 +1034,7 @@ static struct hwentry default_hw[] = {
                .minio         = 100,
                .checker_name  = TUR,
                .prio_name     = DEFAULT_PRIO,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "SUN",
@@ -995,6 +1050,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /* SUN/LSI 2510, 2540, 2530, 2540 */
        {
@@ -1011,6 +1067,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /* LSI Generic rdac storage */
        {
@@ -1027,6 +1084,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        {
                .vendor        = "STK",
@@ -1043,6 +1101,7 @@ static struct hwentry default_hw[] = {
                .minio         = DEFAULT_MINIO,
                .checker_name  = RDAC,
                .prio_name     = PRIO_RDAC,
+               .prio_args     = NULL,
        },
        /*
         * EOL
@@ -1061,6 +1120,7 @@ static struct hwentry default_hw[] = {
                .minio         = 0,
                .checker_name  = NULL,
                .prio_name     = NULL,
+               .prio_args     = NULL,
        },
 };
 
index 9c40f1d..7491682 100644 (file)
@@ -48,6 +48,11 @@ struct prio * prio_lookup (char * name)
        return add_prio(name);
 }
 
+int prio_set_args (struct prio * p, char * args)
+{
+       return snprintf(p->args, PRIO_ARGS_LEN, "%s", args);
+}
+
 struct prio * add_prio (char * name)
 {
        char libname[LIB_PRIO_NAMELEN];
@@ -67,7 +72,7 @@ struct prio * add_prio (char * name)
        condlog(0, "A dynamic linking error occurred: (%s)", errstr);
        if (!handle)
                goto out;
-       p->getprio = (int (*)(struct path *)) dlsym(handle, "getprio");
+       p->getprio = (int (*)(struct path *, char *)) dlsym(handle, "getprio");
        errstr = dlerror();
        if (errstr != NULL)
        condlog(0, "A dynamic linking error occurred: (%s)", errstr);
@@ -83,10 +88,15 @@ out:
 
 int prio_getprio (struct prio * p, struct path * pp)
 {
-       return p->getprio(pp);
+       return p->getprio(pp, p->args);
 }
 
 char * prio_name (struct prio * p)
 {
        return p->name;
 }
+
+char * prio_args (struct prio * p)
+{
+       return p->args;
+}
index fc9277f..fd4a326 100644 (file)
@@ -11,6 +11,7 @@
 #include "memory.h"
 
 #define DEFAULT_PRIO "const"
+#define DEFAULT_PRIO_ARGS ""
 
 /*
  * Known prioritizers for use in hwtable.c
@@ -23,6 +24,7 @@
 #define PRIO_NETAPP "netapp"
 #define PRIO_RANDOM "random"
 #define PRIO_RDAC "rdac"
+#define PRIO_DATACORE "datacore"
 
 /*
  * Value used to mark the fact prio was not defined
  */
 #define LIB_PRIO_NAMELEN 255
 #define PRIO_NAME_LEN 16
+#define PRIO_ARGS_LEN 255
 
 struct prio {
        struct list_head node;
        char name[PRIO_NAME_LEN];
-       int (*getprio)(struct path *);
+       char args[PRIO_ARGS_LEN];
+       int (*getprio)(struct path *, char *);
 };
 
 int init_prio (void);
@@ -47,5 +51,7 @@ struct prio * add_prio (char *);
 struct prio * prio_lookup (char *);
 int prio_getprio (struct prio *, struct path *);
 char * prio_name (struct prio *);
+char * prio_args (struct prio *);
+int prio_set_args (struct prio *, char *);
 
 #endif /* _PRIO_H */
index ede9427..132b39e 100644 (file)
@@ -12,6 +12,7 @@ LIBS = \
        libpriordac.so \
        libprioalua.so \
        libprionetapp.so \
+       libpriodatacore.so \
        libpriohds.so
 
 CFLAGS += -I..
index abf6232..e33e17c 100644 (file)
@@ -61,7 +61,7 @@ get_alua_info(int fd)
        return rc;
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        int rc;
        int aas;
index 529cf82..bf689cd 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <prio.h>
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return 1;
 }
diff --git a/libmultipath/prioritizers/const.h b/libmultipath/prioritizers/const.h
deleted file mode 100644 (file)
index 220db54..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _CONST_H
-#define _CONST_H
-
-#define PRIO_CONST "const"
-int prio_const(struct path * pp);
-
-#endif
diff --git a/libmultipath/prioritizers/datacore.c b/libmultipath/prioritizers/datacore.c
new file mode 100644 (file)
index 0000000..6b7b202
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * (C) 2010 Christophe Varoqui
+ * (C) 2009 Dembach Goo Infromatik GmbH & Co KG
+ * Manon Goo <manon.goo@dg-i.net>
+ *
+ * datacore.c
+ * Version 0.9
+ *
+ * This program was inspired by work from
+ * Matthias Rudolph <matthias.rudolph@hds.com>
+ *
+ * This work is made available on the basis of the
+ * GPLv2 for detials see <http://www.gnu.org/licenses/>.
+ *
+ * Manon Goo 2009
+ *
+ *
+ */
+
+#include <stdio.h>
+#include <sys/ioctl.h>
+
+#include <sys/stat.h>
+#include <sg_include.h>
+#include <debug.h>
+#include <prio.h>
+
+#define INQ_REPLY_LEN 255
+#define INQ_CMD_CODE 0x12
+#define INQ_CMD_LEN 6
+
+#define dc_log(prio, msg) condlog(prio, "%s: datacore prio: " msg, dev)
+
+int datacore_prio (const char *dev, int sg_fd, char * args)
+{
+       int k;
+       char vendor[8];
+       char product[32];
+       char luname[32];
+       char wwpn[32];
+       char sdsname[32];
+       unsigned char inqCmdBlk[INQ_CMD_LEN] = { INQ_CMD_CODE, 0, 0, 0, INQ_REPLY_LEN, 0 };
+       unsigned char inqBuff[INQ_REPLY_LEN];
+       unsigned char *inqBuffp = inqBuff;
+       unsigned char sense_buffer[32];
+       sg_io_hdr_t io_hdr;
+
+        int timeout = 2000;
+       char preferredsds_buff[255] = "";
+       char * preferredsds = &preferredsds_buff[0];
+
+       if (!args) {
+               dc_log(0, "need prio_args with preferredsds set");
+               return 0;
+       }
+
+       if (sscanf(args, "timeout=%i preferredsds=%s",
+                   &timeout, preferredsds) == 2) {}
+       else if (sscanf(args, "preferredsds=%s timeout=%i",
+                       preferredsds, &timeout) == 2) {}
+       else if (sscanf(args, "preferredsds=%s",
+                       preferredsds) == 1) {}
+       else {
+               dc_log(0, "unexpected prio_args format");
+               return 0;
+       }
+
+       // on error just return prio 0
+       if (strlen(preferredsds) <= 1) {
+               dc_log(0, "prio args: preferredsds too short (1 character min)");
+               return 0;
+       }
+       if ((timeout < 500) || (timeout > 20000)) {
+               dc_log(0, "prio args: timeout out of bounds [500:20000]");
+               return 0;
+       }
+       if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000))
+               return 0;
+
+       memset (&io_hdr, 0, sizeof (sg_io_hdr_t));
+       io_hdr.interface_id = 'S';
+       io_hdr.cmd_len = sizeof (inqCmdBlk);
+       io_hdr.mx_sb_len = sizeof (sense_buffer);
+       io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
+       io_hdr.dxfer_len = INQ_REPLY_LEN;
+       io_hdr.dxferp = inqBuff;
+       io_hdr.cmdp = inqCmdBlk;
+       io_hdr.sbp = sense_buffer;
+       io_hdr.timeout = timeout;
+
+       // on error just return prio 0
+       if (ioctl(sg_fd, SG_IO, &io_hdr) < 0)
+               return 0;
+       if ((io_hdr.info & SG_INFO_OK_MASK) != SG_INFO_OK)
+               return 0;
+
+       snprintf(vendor, 9, "%.8s\n", inqBuffp + 8);
+       snprintf(product, 17, "%.16s", inqBuffp + 16);
+       snprintf(luname, 21, "%.19s", inqBuffp + 36);
+       snprintf(wwpn, 17, "%.16s", inqBuffp + 96);
+       snprintf(sdsname, 17, "%.16s", inqBuffp + 112);
+
+       if (strstr(sdsname , preferredsds))
+               return 1;
+       return 0;
+}
+
+int getprio (struct path * pp, char * args)
+{
+        return datacore_prio(pp->dev, pp->fd, args);
+}
+
index 61d7a77..bbf5750 100644 (file)
@@ -73,7 +73,7 @@ out:
        return(ret);
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return emc_clariion_prio(pp->dev, pp->fd);
 }
diff --git a/libmultipath/prioritizers/emc.h b/libmultipath/prioritizers/emc.h
deleted file mode 100644 (file)
index 0ab0bc5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _EMC_H
-#define _EMC_H
-
-#define PRIO_EMC "emc"
-int prio_emc(struct path * pp);
-
-#endif
index 6ebe4d8..7b354b2 100644 (file)
@@ -164,7 +164,7 @@ int hds_modular_prio (const char *dev, int fd)
        return -1;
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return hds_modular_prio(pp->dev, pp->fd);
 }
diff --git a/libmultipath/prioritizers/hds.h b/libmultipath/prioritizers/hds.h
deleted file mode 100644 (file)
index 084d77c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _HDS_H
-#define _HDS_H
-
-#define PRIO_HDS "hds"
-int prio_hds(struct path * pp);
-
-#endif
index ae0975f..2de460f 100644 (file)
@@ -94,7 +94,7 @@ out:
        return(ret);
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return hp_sw_prio(pp->dev, pp->fd);
 }
diff --git a/libmultipath/prioritizers/hp_sw.h b/libmultipath/prioritizers/hp_sw.h
deleted file mode 100644 (file)
index 2fea486..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _HP_SW_H
-#define _HP_SW_H
-
-#define PRIO_HP_SW "hp_sw"
-int prio_hp_sw(struct path * pp);
-
-#endif
index 812ecf6..c695cd3 100644 (file)
@@ -237,7 +237,7 @@ static int netapp_prio(const char *dev, int fd)
        }
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return netapp_prio(pp->dev, pp->fd);
 }
diff --git a/libmultipath/prioritizers/netapp.h b/libmultipath/prioritizers/netapp.h
deleted file mode 100644 (file)
index ec38821..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _NETAPP_H
-#define _NETAPP_H
-
-#define PRIO_NETAPP "netapp"
-int prio_netapp(struct path * pp);
-
-#endif
index e3852a7..281a0d1 100644 (file)
@@ -5,10 +5,10 @@
 
 #include <prio.h>
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        struct timeval tv;
-       
+
        gettimeofday(&tv, NULL);
        srand((unsigned int)tv.tv_usec);
        return 1+(int) (10.0*rand()/(RAND_MAX+1.0));
diff --git a/libmultipath/prioritizers/random.h b/libmultipath/prioritizers/random.h
deleted file mode 100644 (file)
index b9dae69..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _RANDOM_H
-#define _RANDOM_H
-
-#define PRIO_RANDOM "random"
-int prio_random(struct path * pp);
-
-#endif
index 7eafc31..27d51ab 100644 (file)
@@ -85,7 +85,7 @@ out:
        return(ret);
 }
 
-int getprio (struct path * pp)
+int getprio (struct path * pp, char * args)
 {
        return rdac_prio(pp->dev, pp->fd);
 }
diff --git a/libmultipath/prioritizers/rdac.h b/libmultipath/prioritizers/rdac.h
deleted file mode 100644 (file)
index a5b7f8e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _RDAC_H
-#define _RDAC_H
-
-#define PRIO_RDAC "rdac"
-int prio_rdac(struct path * pp);
-
-#endif
index baab020..2187558 100644 (file)
@@ -332,19 +332,28 @@ select_prio (struct path * pp)
 {
        if (pp->hwe && pp->hwe->prio_name) {
                pp->prio = prio_lookup(pp->hwe->prio_name);
+               prio_set_args(pp->prio, pp->hwe->prio_args);
                condlog(3, "%s: prio = %s (controller setting)",
                        pp->dev, pp->hwe->prio_name);
+               condlog(3, "%s: prio args = %s (controller setting)",
+                       pp->dev, pp->hwe->prio_args);
                return 0;
        }
        if (conf->prio_name) {
                pp->prio = prio_lookup(conf->prio_name);
+               prio_set_args(pp->prio, conf->prio_args);
                condlog(3, "%s: prio = %s (config file default)",
                        pp->dev, conf->prio_name);
+               condlog(3, "%s: prio args = %s (config file default)",
+                       pp->dev, conf->prio_args);
                return 0;
        }
        pp->prio = prio_lookup(DEFAULT_PRIO);
+        prio_set_args(pp->prio, DEFAULT_PRIO_ARGS);
        condlog(3, "%s: prio = %s (internal default)",
                pp->dev, DEFAULT_PRIO);
+       condlog(3, "%s: prio = %s (internal default)",
+               pp->dev, DEFAULT_PRIO_ARGS);
        return 0;
 }
 
index d8417d4..cefd6b5 100644 (file)
@@ -21,7 +21,7 @@
 #define _VERSION_H
 
 #define VERSION_CODE 0x000409
-#define DATE_CODE    0x040409
+#define DATE_CODE    0x052110
 
 #define PROG    "multipath-tools"
 
index 4bbdf28..9be7a2d 100644 (file)
@@ -28,7 +28,7 @@
 #
 #      #
 #      # name    : selector
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : the default path selector algorithm to use
 #      #           these algorithms are offered by the kernel multipath target
 #      # values  : "round-robin 0"
@@ -38,7 +38,7 @@
 #
 #      #
 #      # name    : path_grouping_policy
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : the default path grouping policy to apply to unspecified
 #      #           multipaths
 #      # values  : failover           = 1 path per priority group
@@ -54,7 +54,7 @@
 #
 #      #
 #      # name    : getuid_callout
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : the default program and args to callout to obtain a unique 
 #      #           path identifier. Absolute path required
 #      # default : /lib/udev/scsi_id --whitelisted --device=/dev/%n
@@ -63,7 +63,7 @@
 #
 #      #
 #      # name    : prio
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : the default function to call to obtain a path 
 #      #           priority value. The ALUA bits in SPC-3 provide an
 #      #           exploitable prio value for example.
 #      prio    "alua"
 #
 #      #
+#      # name    : prio_args
+#      # scope   : multipath & multipathd
+#      # desc    : The arguments string passed to the prio function
+#      #           Most prio functions do not need arguments. The
+#      #           datacore prioritizer need one.
+#      # default : (null)
+#      #
+#      prio_args       "timeout=1000 preferredsds=foo"
+#
+#      #
 #      # name    : features
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : The default extra features of multipath devices. The
 #      #           only existing feature currently is queue_if_no_path, which
 #      #           is the same as setting no_path_retry to queue.
 #
 #      #
 #      # name    : rr_min_io
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : the number of IO to route to a path before switching
 #      #           to the next in the same path group
 #      # default : 1000
 #
 #      #
 #      # name    : rr_weight
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : if set to priorities the multipath configurator will assign
 #      #           path weights as "path prio * rr_min_io"
 #      # values  : priorities|uniform
 #
 #      #
 #      # name    : user_friendly_names
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : If set to "yes", using the bindings file
 #      #           /etc/multipath/bindings to assign a persistent and
 #      #           unique alias to the multipath, in the form of mpath<n>.
 #
 #      #
 #      # name    : mode
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : The mode to use for the multipath device nodes, in octal.
 #      # values  : 0000 - 0777
 #      # default : determined by the process
 #
 #      #
 #      # name    : uid
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : The user id to use for the multipath device nodes. You
 #      #           may use either the numeric or symbolic uid
 #      # values  : <user_id>
 #
 #      #
 #      # name    : gid
-#      # scope   : multipath
+#      # scope   : multipath & multipathd
 #      # desc    : The group id to user for the multipath device nodes. You
 #      #           may use either the numeric or symbolic gid
 #      # values  : <group_id>
 #
 #              #
 #              # name    : alias
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : symbolic name for the multipath. If you are using
 #              #           user_friendly_names, do not set the alias to
 #              #           mpath<n>. This may conflict with an automatically
 #
 #              #
 #              # name    : path_grouping_policy
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : path grouping policy to apply to this multipath
 #              # values  : failover, multibus, group_by_serial
 #              # values  : failover           = 1 path per priority group
 #
 #              #
 #              # name    : path_selector
+#              # scope   : multipath & multipathd
 #              # desc    : the path selector algorithm to use for this mpath
 #              #           these algo are offered by the kernel mpath target
 #              # values  : "round-robin 0"
 #
 #              #
 #              # name    : rr_weight
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : if set to priorities the multipath configurator will
 #              #           assign path weights as "path prio * rr_min_io"
 #              # values  : priorities|uniform
 #
 #              #
 #              # name    : rr_min_io
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : the number of IO to route to a path before switching
 #              #           to the next in the same path group
 #              #
 #
 #              #
 #              # name    : mode
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : The mode to use for the multipath device nodes, in
 #              #           octal.
 #              # values  : 0000 - 0777
 #
 #              #
 #              # name    : uid
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : The user id to use for the multipath device nodes.
 #              #           You may use either the numeric or symbolic uid
 #              # values  : <user_id>
 #
 #              #
 #              # name    : gid
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : The group id to user for the multipath device nodes.
 #              #           You may use either the numeric or symbolic gid
 #              # values  : <group_id>
 #
 #              #
 #              # name    : path_grouping_policy
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : path grouping policy to apply to this multipath
 #              # values  : failover, multibus, group_by_serial
 #              # values  : failover           = 1 path per priority group
 #
 #              #
 #              # name    : getuid_callout
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : the program and args to callout to obtain a unique 
 #              #           path identifier. Absolute path required
 #              #
 #
 #              #
 #              # name    : prio
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : the function to call to obtain a path 
 #              #           weight. Weights are summed for each path group to
 #              #           determine the next PG to use case of failure.
 #              #
 #              prio          "hp_sw"
 #
+#              #       #
+#              # name    : prio_args
+#              # scope   : multipath & multipathd
+#              # desc    : The arguments string passed to the prio function
+#              #           Most prio functions do not need arguments. The
+#              #           datacore prioritizer need one.
+#              # default : (null)
 #              #
+#              prio_args       "timeout=1000 preferredsds=foo"
+##
 #              # name    : path_checker, checker
-#              # scope   : multipathd
+#              # scope   : multipathd & multipathd
 #              # desc    : path checking alorithm to use to check path state
 #              # values  : readsector0|tur|emc_clariion|hp_sw|directio|rdac|
 #              #           cciss_tur
 #
 #              #
 #              # name    : path_selector
+#              # scope   : multipathd & multipathd
 #              # desc    : the path selector algorithm to use for this mpath
 #              #           these algo are offered by the kernel mpath target
 #              # values  : "round-robin 0"
 #
 #              #
 #              # name    : features
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : The extra features of multipath devices. The only
 #              #           existing feature currently is queue_if_no_path,
 #              #           which is the same as setting no_path_retry to queue.
 #
 #              #
 #              # name    : hardware_handler
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : If set, it specifies a module that will be used to
 #              #           perform hardware specific actions when switching
 #              #           path groups or handling IO errors
 #
 #              #
 #              # name    : rr_weight
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : if set to priorities the multipath configurator will
 #              #           assign path weights as "path prio * rr_min_io"
 #              # values  : priorities|uniform
 #
 #              #
 #              # name    : rr_min_io
-#              # scope   : multipath
+#              # scope   : multipath & multipathd
 #              # desc    : the number of IO to route to a path before switching
 #              #           to the next in the same path group
 #              #
index 5fce694..886a678 100644 (file)
@@ -8,6 +8,7 @@
 #      path_grouping_policy    failover
 #      getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #      prio                    const
+#      prio_args               ""
 #      path_checker            directio
 #      rr_min_io               1000
 #      rr_weight               uniform
@@ -35,6 +36,7 @@
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "3PARdata"
@@ -48,6 +50,7 @@
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "DEC"
@@ -61,6 +64,7 @@
 #              rr_min_io               1000
 #              path_checker            hp_sw
 #              prio                    hp_sw
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "HP"
@@ -75,6 +79,7 @@
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "(COMPAQ|HP)"
@@ -89,6 +94,7 @@
 #              rr_min_io               1000
 #              path_checker            hp_sw
 #              prio                    hp_sw
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "(COMPAQ|HP)"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    alua
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "HP"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "(COMPAQ|HP)"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    alua
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "HP"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "HP"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "DDN"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "EMC"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "DGC"
 #              product                 ".*"
 #              product_blacklist       "LUNZ"
 #              getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
-#              prio_callout            "/sbin/mpath_prio_emc /dev/%n"
 #              features                "1 queue_if_no_path"
 #              hardware_handler        "1 emc"
 #              path_selector           "round-robin 0"
 #              rr_min_io               1000
 #              path_checker            emc_clariion
 #              prio                    emc
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "EMC"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "FSC"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "(HITACHI|HP)"
 #              rr_min_io               100
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "HITACHI"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    hds
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            readsector0
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    alua
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    alua
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "NETAPP"
 #              rr_min_io               128
 #              path_checker            directio
 #              prio                    netapp
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "NEXENTA"
 #              rr_min_io               128
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "IBM"
 #              rr_min_io               128
 #              path_checker            directio
 #              prio                    netapp
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "Pillar"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    alua
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SGI"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SGI"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SGI"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "STK"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SUN"
 #              rr_min_io               1000
 #              path_checker            directio
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "PIVOT3"
 #              rr_min_io               1000
 #              path_checker            tur
 #              prio                    const
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SUN"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "SUN"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #      device {
 #              vendor                  "STK"
 #              rr_min_io               1000
 #              path_checker            rdac
 #              prio                    rdac
+#              prio_args               ""
 #      }
 #}