return 0;
}
+static int
+mp_prio_handler(vector strvec)
+{
+ struct mpentry * mpe = VECTOR_LAST_SLOT(conf->hwtable);
+
+ if (!mpe)
+ return 1;
+
+ mpe->prio_name = set_value(strvec);
+
+ if (!mpe->prio_name)
+ return 1;
+
+ return 0;
+}
+
+static int
+mp_prio_args_handler (vector strvec)
+{
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ mpe->prio_args = set_value(strvec);
+ if (!mpe->prio_args)
+ return 1;
+
+ return 0;
+}
+
/*
* config file keywords printing
*/
}
static int
+snprint_mp_prio(char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if (!mpe->prio_name)
+ return 0;
+
+ return snprintf(buff, len, "%s", mpe->prio_name);
+}
+
+static int
+snprint_mp_prio_args(char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if (!mpe->prio_args)
+ return 0;
+
+ return snprintf(buff, len, "%s", mpe->prio_args);
+}
+
+static int
snprint_hw_fast_io_fail(char * buff, int len, void * data)
{
struct hwentry * hwe = (struct hwentry *)data;
{
struct hwentry * hwe = (struct hwentry *)data;
- if (!hwe->prio_args)
- return 0;
+ if (!hwe->prio_args)
+ return 0;
return snprintf(buff, len, "\"%s\"", hwe->prio_args);
}
install_keyword("alias", &alias_handler, &snprint_mp_alias);
install_keyword("path_grouping_policy", &mp_pgpolicy_handler, &snprint_mp_path_grouping_policy);
install_keyword("path_selector", &mp_selector_handler, &snprint_mp_selector);
+ install_keyword("prio", &mp_prio_handler, &snprint_mp_prio);
+ install_keyword("prio_args", &mp_prio_args_handler, &snprint_mp_prio_args);
install_keyword("failback", &mp_failback_handler, &snprint_mp_failback);
install_keyword("rr_weight", &mp_weight_handler, &snprint_mp_rr_weight);
install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
extern int
select_prio (struct path * pp)
{
+ struct mpentry * mpe;
+
+ if ((mpe = find_mpe(pp->wwid))) {
+ if (mpe->prio_name) {
+ pp->prio = prio_lookup(mpe->prio_name);
+ prio_set_args(pp->prio, mpe->prio_args);
+ condlog(3, "%s: prio = %s (LUN setting)",
+ pp->dev, pp->prio->name);
+ return 0;
+ }
+ }
+
if (pp->hwe && pp->hwe->prio_name) {
pp->prio = prio_lookup(pp->hwe->prio_name);
prio_set_args(pp->prio, pp->hwe->prio_args);
return 0;
}
pp->prio = prio_lookup(DEFAULT_PRIO);
- prio_set_args(pp->prio, DEFAULT_PRIO_ARGS);
+ 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)",