2 * Based on Alexandre Cassen template for keepalived
3 * Copyright (c) 2004, 2005, 2006 Christophe Varoqui
4 * Copyright (c) 2005 Benjamin Marzinski, Redhat
5 * Copyright (c) 2005 Kiyoshi Ueda, NEC
19 #include "pgpolicies.h"
20 #include "blacklist.h"
27 #include <mpath_persist.h>
28 #include "mpath_cmd.h"
33 do_set_int(vector strvec, void *ptr, int min, int max, const char *file,
34 int line_nr, char *buff)
36 int *int_ptr = (int *)ptr;
40 res = strtol(buff, &eptr, 10);
42 while (isspace(*eptr))
44 if (*buff == '\0' || *eptr != '\0') {
45 condlog(1, "%s line %d, invalid value for %s: \"%s\"",
46 file, line_nr, (char*)VECTOR_SLOT(strvec, 0), buff);
49 if (res > max || res < min) {
50 res = (res > max) ? max : min;
51 condlog(1, "%s line %d, value for %s too %s, capping at %ld",
52 file, line_nr, (char*)VECTOR_SLOT(strvec, 0),
53 (res == max)? "large" : "small", res);
60 set_int(vector strvec, void *ptr, int min, int max, const char *file,
65 buff = set_value(strvec);
69 do_set_int(strvec, ptr, min, max, file, line_nr, buff);
76 set_uint(vector strvec, void *ptr, const char *file, int line_nr)
78 unsigned int *uint_ptr = (unsigned int *)ptr;
79 char *buff, *eptr, *p;
82 buff = set_value(strvec);
89 res = strtoul(p, &eptr, 10);
91 while (isspace(*eptr))
93 if (*buff == '\0' || *eptr != '\0' || !isdigit(*p) || res > UINT_MAX)
94 condlog(1, "%s line %d, invalid value for %s: \"%s\"",
95 file, line_nr, (char*)VECTOR_SLOT(strvec, 0), buff);
104 set_str(vector strvec, void *ptr, const char *file, int line_nr)
106 char **str_ptr = (char **)ptr;
110 *str_ptr = set_value(strvec);
119 set_dir(vector strvec, void *ptr, const char *file, int line_nr)
121 char **str_ptr = (char **)ptr;
122 char *old_str = *str_ptr;
125 *str_ptr = set_value(strvec);
130 if ((*str_ptr)[0] != '/'){
131 condlog(1, "%s line %d, %s is not an absolute directory path. Ignoring", file, line_nr, *str_ptr);
134 if (stat(*str_ptr, &sb) == 0 && S_ISDIR(sb.st_mode))
137 condlog(1, "%s line %d, %s is not an existing directory. Ignoring", file, line_nr, *str_ptr);
145 set_path(vector strvec, void *ptr, const char *file, int line_nr)
147 char **str_ptr = (char **)ptr;
148 char *old_str = *str_ptr;
150 *str_ptr = set_value(strvec);
155 if ((*str_ptr)[0] != '/'){
156 condlog(1, "%s line %d, %s is not an absolute path. Ignoring",
157 file, line_nr, *str_ptr);
165 set_str_noslash(vector strvec, void *ptr, const char *file, int line_nr)
167 char **str_ptr = (char **)ptr;
168 char *old_str = *str_ptr;
170 *str_ptr = set_value(strvec);
175 if (strchr(*str_ptr, '/')) {
176 condlog(1, "%s line %d, %s cannot contain a slash. Ignoring",
177 file, line_nr, *str_ptr);
185 set_yes_no(vector strvec, void *ptr, const char *file, int line_nr)
188 int *int_ptr = (int *)ptr;
190 buff = set_value(strvec);
194 if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0)
196 else if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0)
199 condlog(1, "%s line %d, invalid value for %s: \"%s\"",
200 file, line_nr, (char*)VECTOR_SLOT(strvec, 0), buff);
207 set_yes_no_undef(vector strvec, void *ptr, const char *file, int line_nr)
210 int *int_ptr = (int *)ptr;
212 buff = set_value(strvec);
216 if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0)
218 else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0)
221 condlog(1, "%s line %d, invalid value for %s: \"%s\"",
222 file, line_nr, (char*)VECTOR_SLOT(strvec, 0), buff);
228 static int print_int(struct strbuf *buff, long v)
230 return print_strbuf(buff, "%li", v);
233 static int print_nonzero(struct strbuf *buff, long v)
237 return print_strbuf(buff, "%li", v);
240 static int print_str(struct strbuf *buff, const char *ptr)
242 int ret = append_strbuf_quoted(buff, ptr);
245 * -EINVAL aka (ptr == NULL) means "not set".
246 * Returning an error here breaks unit tests
247 * (logic in snprint_keyword()).
249 return ret == -EINVAL ? 0 : ret;
252 static int print_ignored(struct strbuf *buff)
254 return append_strbuf_quoted(buff, "ignored");
257 static int print_yes_no(struct strbuf *buff, long v)
259 return append_strbuf_quoted(buff, v == YN_NO ? "no" : "yes");
262 static int print_yes_no_undef(struct strbuf *buff, long v)
266 return append_strbuf_quoted(buff, v == YNU_NO? "no" : "yes");
269 #define declare_def_handler(option, function) \
271 def_ ## option ## _handler (struct config *conf, vector strvec, \
272 const char *file, int line_nr) \
274 return function (strvec, &conf->option, file, line_nr); \
277 #define declare_def_warn_handler(option, function) \
279 def_ ## option ## _handler (struct config *conf, vector strvec, \
280 const char *file, int line_nr) \
282 condlog(2, "%s line %d, \"" #option "\" is deprecated and will be disabled in a future release", file, line_nr); \
283 return function (strvec, &conf->option, file, line_nr); \
286 #define declare_def_range_handler(option, minval, maxval) \
288 def_ ## option ## _handler (struct config *conf, vector strvec, \
289 const char *file, int line_nr) \
291 return set_int(strvec, &conf->option, minval, maxval, file, line_nr); \
294 #define declare_def_snprint(option, function) \
296 snprint_def_ ## option (struct config *conf, struct strbuf *buff, \
299 return function(buff, conf->option); \
302 #define declare_def_snprint_defint(option, function, value) \
304 snprint_def_ ## option (struct config *conf, struct strbuf *buff, \
309 return function(buff, i); \
310 return function (buff, conf->option); \
313 #define declare_def_snprint_defstr(option, function, value) \
315 snprint_def_ ## option (struct config *conf, struct strbuf *buff, \
318 static const char *s = value; \
320 return function(buff, s); \
321 return function(buff, conf->option); \
324 #define declare_hw_handler(option, function) \
326 hw_ ## option ## _handler (struct config *conf, vector strvec, \
327 const char *file, int line_nr) \
329 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); \
332 return function (strvec, &hwe->option, file, line_nr); \
335 #define declare_hw_range_handler(option, minval, maxval) \
337 hw_ ## option ## _handler (struct config *conf, vector strvec, \
338 const char *file, int line_nr) \
340 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); \
343 return set_int(strvec, &hwe->option, minval, maxval, file, line_nr); \
347 #define declare_hw_snprint(option, function) \
349 snprint_hw_ ## option (struct config *conf, struct strbuf *buff, \
352 const struct hwentry * hwe = (const struct hwentry *)data; \
353 return function(buff, hwe->option); \
356 #define declare_ovr_handler(option, function) \
358 ovr_ ## option ## _handler (struct config *conf, vector strvec, \
359 const char *file, int line_nr) \
361 if (!conf->overrides) \
363 return function (strvec, &conf->overrides->option, file, line_nr); \
366 #define declare_ovr_range_handler(option, minval, maxval) \
368 ovr_ ## option ## _handler (struct config *conf, vector strvec, \
369 const char *file, int line_nr) \
371 if (!conf->overrides) \
373 return set_int(strvec, &conf->overrides->option, minval, maxval, \
377 #define declare_ovr_snprint(option, function) \
379 snprint_ovr_ ## option (struct config *conf, struct strbuf *buff, \
382 return function (buff, conf->overrides->option); \
385 #define declare_mp_handler(option, function) \
387 mp_ ## option ## _handler (struct config *conf, vector strvec, \
388 const char *file, int line_nr) \
390 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable); \
393 return function (strvec, &mpe->option, file, line_nr); \
396 #define declare_mp_range_handler(option, minval, maxval) \
398 mp_ ## option ## _handler (struct config *conf, vector strvec, \
399 const char *file, int line_nr) \
401 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable); \
404 return set_int(strvec, &mpe->option, minval, maxval, file, line_nr); \
407 #define declare_mp_snprint(option, function) \
409 snprint_mp_ ## option (struct config *conf, struct strbuf *buff, \
412 const struct mpentry * mpe = (const struct mpentry *)data; \
413 return function(buff, mpe->option); \
416 static int checkint_handler(struct config *conf, vector strvec,
417 const char *file, int line_nr)
419 int rc = set_uint(strvec, &conf->checkint, file, line_nr);
423 if (conf->checkint == CHECKINT_UNDEF)
428 declare_def_snprint(checkint, print_int)
430 declare_def_handler(max_checkint, set_uint)
431 declare_def_snprint(max_checkint, print_int)
433 declare_def_range_handler(verbosity, 0, MAX_VERBOSITY)
434 declare_def_snprint(verbosity, print_int)
436 declare_def_handler(reassign_maps, set_yes_no)
437 declare_def_snprint(reassign_maps, print_yes_no)
439 declare_def_warn_handler(multipath_dir, set_dir)
440 declare_def_snprint(multipath_dir, print_str)
442 static int def_partition_delim_handler(struct config *conf, vector strvec,
443 const char *file, int line_nr)
445 int rc = set_str_noslash(strvec, &conf->partition_delim, file, line_nr);
450 if (!strcmp(conf->partition_delim, UNSET_PARTITION_DELIM)) {
451 free(conf->partition_delim);
452 conf->partition_delim = NULL;
457 static int snprint_def_partition_delim(struct config *conf, struct strbuf *buff,
460 if (default_partition_delim == NULL || conf->partition_delim != NULL)
461 return print_str(buff, conf->partition_delim);
463 return print_str(buff, UNSET_PARTITION_DELIM);
466 static const char * const find_multipaths_optvals[] = {
467 [FIND_MULTIPATHS_OFF] = "off",
468 [FIND_MULTIPATHS_ON] = "on",
469 [FIND_MULTIPATHS_STRICT] = "strict",
470 [FIND_MULTIPATHS_GREEDY] = "greedy",
471 [FIND_MULTIPATHS_SMART] = "smart",
475 def_find_multipaths_handler(struct config *conf, vector strvec,
476 const char *file, int line_nr)
481 buff = set_value(strvec);
485 for (i = FIND_MULTIPATHS_OFF; i < __FIND_MULTIPATHS_LAST; i++) {
486 if (find_multipaths_optvals[i] != NULL &&
487 !strcmp(buff, find_multipaths_optvals[i])) {
488 conf->find_multipaths = i;
493 if (i >= __FIND_MULTIPATHS_LAST) {
494 if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0)
495 conf->find_multipaths = FIND_MULTIPATHS_OFF;
496 else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0)
497 conf->find_multipaths = FIND_MULTIPATHS_ON;
499 condlog(1, "%s line %d, invalid value for find_multipaths: \"%s\"",
500 file, line_nr, buff);
508 snprint_def_find_multipaths(struct config *conf, struct strbuf *buff,
511 return append_strbuf_quoted(buff,
512 find_multipaths_optvals[conf->find_multipaths]);
515 declare_def_handler(selector, set_str)
516 declare_def_snprint_defstr(selector, print_str, DEFAULT_SELECTOR)
517 declare_hw_handler(selector, set_str)
518 declare_hw_snprint(selector, print_str)
519 declare_ovr_handler(selector, set_str)
520 declare_ovr_snprint(selector, print_str)
521 declare_mp_handler(selector, set_str)
522 declare_mp_snprint(selector, print_str)
524 static int snprint_uid_attrs(struct config *conf, struct strbuf *buff,
527 int j, ret, total = 0;
530 vector_foreach_slot(&conf->uid_attrs, att, j) {
531 ret = print_strbuf(buff, "%s%s", j == 0 ? "" : " ", att);
539 static int uid_attrs_handler(struct config *conf, vector strvec,
540 const char *file, int line_nr)
544 vector_reset(&conf->uid_attrs);
545 val = set_value(strvec);
548 if (parse_uid_attrs(val, conf))
549 condlog(1, "%s line %d,error parsing uid_attrs: \"%s\"", file,
552 condlog(4, "parsed %d uid_attrs", VECTOR_SIZE(&conf->uid_attrs));
557 declare_def_handler(uid_attribute, set_str)
558 declare_def_snprint_defstr(uid_attribute, print_str, DEFAULT_UID_ATTRIBUTE)
559 declare_ovr_handler(uid_attribute, set_str)
560 declare_ovr_snprint(uid_attribute, print_str)
561 declare_hw_handler(uid_attribute, set_str)
562 declare_hw_snprint(uid_attribute, print_str)
564 declare_def_handler(getuid, set_str)
565 declare_def_snprint(getuid, print_str)
566 declare_ovr_handler(getuid, set_str)
567 declare_ovr_snprint(getuid, print_str)
568 declare_hw_handler(getuid, set_str)
569 declare_hw_snprint(getuid, print_str)
571 declare_def_handler(prio_name, set_str)
572 declare_def_snprint_defstr(prio_name, print_str, DEFAULT_PRIO)
573 declare_ovr_handler(prio_name, set_str)
574 declare_ovr_snprint(prio_name, print_str)
575 declare_hw_handler(prio_name, set_str)
576 declare_hw_snprint(prio_name, print_str)
577 declare_mp_handler(prio_name, set_str)
578 declare_mp_snprint(prio_name, print_str)
580 declare_def_handler(alias_prefix, set_str_noslash)
581 declare_def_snprint_defstr(alias_prefix, print_str, DEFAULT_ALIAS_PREFIX)
582 declare_ovr_handler(alias_prefix, set_str_noslash)
583 declare_ovr_snprint(alias_prefix, print_str)
584 declare_hw_handler(alias_prefix, set_str_noslash)
585 declare_hw_snprint(alias_prefix, print_str)
587 declare_def_handler(prio_args, set_str)
588 declare_def_snprint_defstr(prio_args, print_str, DEFAULT_PRIO_ARGS)
589 declare_ovr_handler(prio_args, set_str)
590 declare_ovr_snprint(prio_args, print_str)
591 declare_hw_handler(prio_args, set_str)
592 declare_hw_snprint(prio_args, print_str)
593 declare_mp_handler(prio_args, set_str)
594 declare_mp_snprint(prio_args, print_str)
596 declare_def_handler(features, set_str)
597 declare_def_snprint_defstr(features, print_str, DEFAULT_FEATURES)
598 declare_ovr_handler(features, set_str)
599 declare_ovr_snprint(features, print_str)
600 declare_hw_handler(features, set_str)
601 declare_hw_snprint(features, print_str)
602 declare_mp_handler(features, set_str)
603 declare_mp_snprint(features, print_str)
605 declare_def_handler(checker_name, set_str)
606 declare_def_snprint_defstr(checker_name, print_str, DEFAULT_CHECKER)
607 declare_ovr_handler(checker_name, set_str)
608 declare_ovr_snprint(checker_name, print_str)
609 declare_hw_handler(checker_name, set_str)
610 declare_hw_snprint(checker_name, print_str)
612 declare_def_range_handler(minio, 0, INT_MAX)
613 declare_def_snprint_defint(minio, print_int, DEFAULT_MINIO)
614 declare_ovr_range_handler(minio, 0, INT_MAX)
615 declare_ovr_snprint(minio, print_nonzero)
616 declare_hw_range_handler(minio, 0, INT_MAX)
617 declare_hw_snprint(minio, print_nonzero)
618 declare_mp_range_handler(minio, 0, INT_MAX)
619 declare_mp_snprint(minio, print_nonzero)
621 declare_def_range_handler(minio_rq, 0, INT_MAX)
622 declare_def_snprint_defint(minio_rq, print_int, DEFAULT_MINIO_RQ)
623 declare_ovr_range_handler(minio_rq, 0, INT_MAX)
624 declare_ovr_snprint(minio_rq, print_nonzero)
625 declare_hw_range_handler(minio_rq, 0, INT_MAX)
626 declare_hw_snprint(minio_rq, print_nonzero)
627 declare_mp_range_handler(minio_rq, 0, INT_MAX)
628 declare_mp_snprint(minio_rq, print_nonzero)
630 declare_def_handler(queue_without_daemon, set_yes_no)
632 snprint_def_queue_without_daemon(struct config *conf, struct strbuf *buff,
635 const char *qwd = "unknown";
637 switch (conf->queue_without_daemon) {
638 case QUE_NO_DAEMON_OFF:
641 case QUE_NO_DAEMON_ON:
644 case QUE_NO_DAEMON_FORCE:
648 return append_strbuf_quoted(buff, qwd);
651 declare_def_range_handler(checker_timeout, 0, INT_MAX)
652 declare_def_snprint(checker_timeout, print_nonzero)
654 declare_def_handler(allow_usb_devices, set_yes_no)
655 declare_def_snprint(allow_usb_devices, print_yes_no)
657 declare_def_handler(flush_on_last_del, set_yes_no_undef)
658 declare_def_snprint_defint(flush_on_last_del, print_yes_no_undef, DEFAULT_FLUSH)
659 declare_ovr_handler(flush_on_last_del, set_yes_no_undef)
660 declare_ovr_snprint(flush_on_last_del, print_yes_no_undef)
661 declare_hw_handler(flush_on_last_del, set_yes_no_undef)
662 declare_hw_snprint(flush_on_last_del, print_yes_no_undef)
663 declare_mp_handler(flush_on_last_del, set_yes_no_undef)
664 declare_mp_snprint(flush_on_last_del, print_yes_no_undef)
666 declare_def_handler(user_friendly_names, set_yes_no_undef)
667 declare_def_snprint_defint(user_friendly_names, print_yes_no_undef,
668 DEFAULT_USER_FRIENDLY_NAMES)
669 declare_ovr_handler(user_friendly_names, set_yes_no_undef)
670 declare_ovr_snprint(user_friendly_names, print_yes_no_undef)
671 declare_hw_handler(user_friendly_names, set_yes_no_undef)
672 declare_hw_snprint(user_friendly_names, print_yes_no_undef)
673 declare_mp_handler(user_friendly_names, set_yes_no_undef)
674 declare_mp_snprint(user_friendly_names, print_yes_no_undef)
676 declare_def_warn_handler(bindings_file, set_path)
677 declare_def_snprint(bindings_file, print_str)
679 declare_def_warn_handler(wwids_file, set_path)
680 declare_def_snprint(wwids_file, print_str)
682 declare_def_warn_handler(prkeys_file, set_path)
683 declare_def_snprint(prkeys_file, print_str)
685 declare_def_handler(retain_hwhandler, set_yes_no_undef)
686 declare_def_snprint_defint(retain_hwhandler, print_yes_no_undef,
687 DEFAULT_RETAIN_HWHANDLER)
688 declare_ovr_handler(retain_hwhandler, set_yes_no_undef)
689 declare_ovr_snprint(retain_hwhandler, print_yes_no_undef)
690 declare_hw_handler(retain_hwhandler, set_yes_no_undef)
691 declare_hw_snprint(retain_hwhandler, print_yes_no_undef)
693 declare_def_handler(detect_prio, set_yes_no_undef)
694 declare_def_snprint_defint(detect_prio, print_yes_no_undef,
696 declare_ovr_handler(detect_prio, set_yes_no_undef)
697 declare_ovr_snprint(detect_prio, print_yes_no_undef)
698 declare_hw_handler(detect_prio, set_yes_no_undef)
699 declare_hw_snprint(detect_prio, print_yes_no_undef)
701 declare_def_handler(detect_checker, set_yes_no_undef)
702 declare_def_snprint_defint(detect_checker, print_yes_no_undef,
703 DEFAULT_DETECT_CHECKER)
704 declare_ovr_handler(detect_checker, set_yes_no_undef)
705 declare_ovr_snprint(detect_checker, print_yes_no_undef)
706 declare_hw_handler(detect_checker, set_yes_no_undef)
707 declare_hw_snprint(detect_checker, print_yes_no_undef)
709 declare_def_handler(force_sync, set_yes_no)
710 declare_def_snprint(force_sync, print_yes_no)
712 declare_def_handler(deferred_remove, set_yes_no_undef)
713 declare_def_snprint_defint(deferred_remove, print_yes_no_undef,
714 DEFAULT_DEFERRED_REMOVE)
715 declare_ovr_handler(deferred_remove, set_yes_no_undef)
716 declare_ovr_snprint(deferred_remove, print_yes_no_undef)
717 declare_hw_handler(deferred_remove, set_yes_no_undef)
718 declare_hw_snprint(deferred_remove, print_yes_no_undef)
719 declare_mp_handler(deferred_remove, set_yes_no_undef)
720 declare_mp_snprint(deferred_remove, print_yes_no_undef)
722 declare_def_range_handler(retrigger_tries, 0, INT_MAX)
723 declare_def_snprint(retrigger_tries, print_int)
725 declare_def_range_handler(retrigger_delay, 0, INT_MAX)
726 declare_def_snprint(retrigger_delay, print_int)
728 declare_def_range_handler(uev_wait_timeout, 0, INT_MAX)
729 declare_def_snprint(uev_wait_timeout, print_int)
731 declare_def_handler(strict_timing, set_yes_no)
732 declare_def_snprint(strict_timing, print_yes_no)
734 declare_def_handler(skip_kpartx, set_yes_no_undef)
735 declare_def_snprint_defint(skip_kpartx, print_yes_no_undef,
737 declare_ovr_handler(skip_kpartx, set_yes_no_undef)
738 declare_ovr_snprint(skip_kpartx, print_yes_no_undef)
739 declare_hw_handler(skip_kpartx, set_yes_no_undef)
740 declare_hw_snprint(skip_kpartx, print_yes_no_undef)
741 declare_mp_handler(skip_kpartx, set_yes_no_undef)
742 declare_mp_snprint(skip_kpartx, print_yes_no_undef)
743 static int def_disable_changed_wwids_handler(struct config *conf, vector strvec,
744 const char *file, int line_nr)
748 static int snprint_def_disable_changed_wwids(struct config *conf,
752 return print_ignored(buff);
755 declare_def_range_handler(remove_retries, 0, INT_MAX)
756 declare_def_snprint(remove_retries, print_int)
758 declare_def_range_handler(max_sectors_kb, 0, INT_MAX)
759 declare_def_snprint(max_sectors_kb, print_nonzero)
760 declare_ovr_range_handler(max_sectors_kb, 0, INT_MAX)
761 declare_ovr_snprint(max_sectors_kb, print_nonzero)
762 declare_hw_range_handler(max_sectors_kb, 0, INT_MAX)
763 declare_hw_snprint(max_sectors_kb, print_nonzero)
764 declare_mp_range_handler(max_sectors_kb, 0, INT_MAX)
765 declare_mp_snprint(max_sectors_kb, print_nonzero)
767 declare_def_range_handler(find_multipaths_timeout, INT_MIN, INT_MAX)
768 declare_def_snprint_defint(find_multipaths_timeout, print_int,
769 DEFAULT_FIND_MULTIPATHS_TIMEOUT)
771 declare_def_handler(enable_foreign, set_str)
772 declare_def_snprint_defstr(enable_foreign, print_str,
773 DEFAULT_ENABLE_FOREIGN)
776 def_config_dir_handler(struct config *conf, vector strvec, const char *file,
779 /* this is only valid in the main config file */
780 if (conf->processed_main_config) {
781 condlog(1, "%s line %d, config_dir option only valid in /etc/multipath.conf",
785 condlog(2, "%s line %d, \"config_dir\" is deprecated and will be disabled in a future release",
787 return set_path(strvec, &conf->config_dir, file, line_nr);
789 declare_def_snprint(config_dir, print_str)
791 #define declare_def_attr_handler(option, function) \
793 def_ ## option ## _handler (struct config *conf, vector strvec, \
794 const char *file, int line_nr) \
796 return function (strvec, &conf->option, &conf->attribute_flags, \
800 #define declare_def_attr_snprint(option, function) \
802 snprint_def_ ## option (struct config *conf, struct strbuf *buff, \
805 return function(buff, conf->option, conf->attribute_flags); \
808 #define declare_mp_attr_handler(option, function) \
810 mp_ ## option ## _handler (struct config *conf, vector strvec, \
811 const char *file, int line_nr) \
813 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable); \
816 return function (strvec, &mpe->option, &mpe->attribute_flags, \
820 #define declare_mp_attr_snprint(option, function) \
822 snprint_mp_ ## option (struct config *conf, struct strbuf *buff, \
825 const struct mpentry * mpe = (const struct mpentry *)data; \
826 return function(buff, mpe->option, mpe->attribute_flags); \
830 set_mode(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
833 mode_t *mode_ptr = (mode_t *)ptr;
836 buff = set_value(strvec);
841 if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777) {
842 *flags |= (1 << ATTR_MODE);
845 condlog(1, "%s line %d, invalid value for mode: \"%s\"",
846 file, line_nr, buff);
853 set_uid(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
856 uid_t *uid_ptr = (uid_t *)ptr;
858 char passwd_buf[1024];
859 struct passwd info, *found;
861 buff = set_value(strvec);
864 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
865 *flags |= (1 << ATTR_UID);
866 *uid_ptr = info.pw_uid;
868 else if (sscanf(buff, "%u", &uid) == 1){
869 *flags |= (1 << ATTR_UID);
872 condlog(1, "%s line %d, invalid value for uid: \"%s\"",
873 file, line_nr, buff);
880 set_gid(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
883 gid_t *gid_ptr = (gid_t *)ptr;
885 char passwd_buf[1024];
886 struct passwd info, *found;
888 buff = set_value(strvec);
892 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
893 *flags |= (1 << ATTR_GID);
894 *gid_ptr = info.pw_gid;
896 else if (sscanf(buff, "%u", &gid) == 1){
897 *flags |= (1 << ATTR_GID);
900 condlog(1, "%s line %d, invalid value for gid: \"%s\"",
901 file, line_nr, buff);
907 print_mode(struct strbuf *buff, long v, int flags)
909 mode_t mode = (mode_t)v;
910 if ((flags & (1 << ATTR_MODE)) == 0)
912 return print_strbuf(buff, "0%o", mode);
916 print_uid(struct strbuf *buff, long v, int flags)
918 uid_t uid = (uid_t)v;
919 if ((flags & (1 << ATTR_UID)) == 0)
921 return print_strbuf(buff, "0%o", uid);
925 print_gid(struct strbuf *buff, long v, int flags)
927 gid_t gid = (gid_t)v;
928 if ((flags & (1 << ATTR_GID)) == 0)
930 return print_strbuf(buff, "0%o", gid);
933 declare_def_attr_handler(mode, set_mode)
934 declare_def_attr_snprint(mode, print_mode)
935 declare_mp_attr_handler(mode, set_mode)
936 declare_mp_attr_snprint(mode, print_mode)
938 declare_def_attr_handler(uid, set_uid)
939 declare_def_attr_snprint(uid, print_uid)
940 declare_mp_attr_handler(uid, set_uid)
941 declare_mp_attr_snprint(uid, print_uid)
943 declare_def_attr_handler(gid, set_gid)
944 declare_def_attr_snprint(gid, print_gid)
945 declare_mp_attr_handler(gid, set_gid)
946 declare_mp_attr_snprint(gid, print_gid)
949 set_undef_off_zero(vector strvec, void *ptr, const char *file, int line_nr)
952 int *int_ptr = (int *)ptr;
954 buff = set_value(strvec);
958 if (strcmp(buff, "off") == 0)
960 else if (strcmp(buff, "0") == 0)
963 do_set_int(strvec, int_ptr, 1, INT_MAX, file, line_nr, buff);
969 int print_undef_off_zero(struct strbuf *buff, long v)
974 return append_strbuf_str(buff, "off");
976 return append_strbuf_str(buff, "0");
977 return print_int(buff, v);
980 declare_def_handler(fast_io_fail, set_undef_off_zero)
981 declare_def_snprint_defint(fast_io_fail, print_undef_off_zero,
982 DEFAULT_FAST_IO_FAIL)
983 declare_ovr_handler(fast_io_fail, set_undef_off_zero)
984 declare_ovr_snprint(fast_io_fail, print_undef_off_zero)
985 declare_hw_handler(fast_io_fail, set_undef_off_zero)
986 declare_hw_snprint(fast_io_fail, print_undef_off_zero)
989 set_dev_loss(vector strvec, void *ptr, const char *file, int line_nr)
992 unsigned int *uint_ptr = (unsigned int *)ptr;
994 buff = set_value(strvec);
998 if (!strcmp(buff, "infinity"))
999 *uint_ptr = MAX_DEV_LOSS_TMO;
1000 else if (sscanf(buff, "%u", uint_ptr) != 1)
1001 condlog(1, "%s line %d, invalid value for dev_loss_tmo: \"%s\"",
1002 file, line_nr, buff);
1009 print_dev_loss(struct strbuf *buff, unsigned long v)
1011 if (v == DEV_LOSS_TMO_UNSET)
1013 if (v >= MAX_DEV_LOSS_TMO)
1014 return append_strbuf_quoted(buff, "infinity");
1015 return print_strbuf(buff, "%lu", v);
1018 declare_def_handler(dev_loss, set_dev_loss)
1019 declare_def_snprint(dev_loss, print_dev_loss)
1020 declare_ovr_handler(dev_loss, set_dev_loss)
1021 declare_ovr_snprint(dev_loss, print_dev_loss)
1022 declare_hw_handler(dev_loss, set_dev_loss)
1023 declare_hw_snprint(dev_loss, print_dev_loss)
1025 declare_def_handler(eh_deadline, set_undef_off_zero)
1026 declare_def_snprint(eh_deadline, print_undef_off_zero)
1027 declare_ovr_handler(eh_deadline, set_undef_off_zero)
1028 declare_ovr_snprint(eh_deadline, print_undef_off_zero)
1029 declare_hw_handler(eh_deadline, set_undef_off_zero)
1030 declare_hw_snprint(eh_deadline, print_undef_off_zero)
1033 set_pgpolicy(vector strvec, void *ptr, const char *file, int line_nr)
1037 int *int_ptr = (int *)ptr;
1039 buff = set_value(strvec);
1043 policy = get_pgpolicy_id(buff);
1044 if (policy != IOPOLICY_UNDEF)
1047 condlog(1, "%s line %d, invalid value for path_grouping_policy: \"%s\"",
1048 file, line_nr, buff);
1055 print_pgpolicy(struct strbuf *buff, long pgpolicy)
1057 char str[POLICY_NAME_SIZE];
1062 get_pgpolicy_name(str, POLICY_NAME_SIZE, pgpolicy);
1064 return append_strbuf_quoted(buff, str);
1067 declare_def_handler(pgpolicy, set_pgpolicy)
1068 declare_def_snprint_defint(pgpolicy, print_pgpolicy, DEFAULT_PGPOLICY)
1069 declare_ovr_handler(pgpolicy, set_pgpolicy)
1070 declare_ovr_snprint(pgpolicy, print_pgpolicy)
1071 declare_hw_handler(pgpolicy, set_pgpolicy)
1072 declare_hw_snprint(pgpolicy, print_pgpolicy)
1073 declare_mp_handler(pgpolicy, set_pgpolicy)
1074 declare_mp_snprint(pgpolicy, print_pgpolicy)
1077 get_sys_max_fds(int *max_fds)
1083 file = fopen("/proc/sys/fs/nr_open", "r");
1085 fprintf(stderr, "Cannot open /proc/sys/fs/nr_open : %s\n",
1089 if (fscanf(file, "%d", &nr_open) != 1) {
1090 fprintf(stderr, "Cannot read max open fds from /proc/sys/fs/nr_open");
1092 fprintf(stderr, " : %s\n", strerror(errno));
1094 fprintf(stderr, "\n");
1105 max_fds_handler(struct config *conf, vector strvec, const char *file,
1111 buff = set_value(strvec);
1116 if (get_sys_max_fds(&max_fds) != 0)
1117 max_fds = 4096; /* Assume safe limit */
1118 if (!strcmp(buff, "max"))
1119 conf->max_fds = max_fds;
1121 do_set_int(strvec, &conf->max_fds, 0, max_fds, file, line_nr,
1130 snprint_max_fds (struct config *conf, struct strbuf *buff, const void *data)
1137 r = get_sys_max_fds(&max_fds);
1138 if (!r && conf->max_fds >= max_fds)
1139 return append_strbuf_quoted(buff, "max");
1141 return print_int(buff, conf->max_fds);
1145 set_rr_weight(vector strvec, void *ptr, const char *file, int line_nr)
1147 int *int_ptr = (int *)ptr;
1150 buff = set_value(strvec);
1155 if (!strcmp(buff, "priorities"))
1156 *int_ptr = RR_WEIGHT_PRIO;
1157 else if (!strcmp(buff, "uniform"))
1158 *int_ptr = RR_WEIGHT_NONE;
1160 condlog(1, "%s line %d, invalid value for rr_weight: \"%s\"",
1161 file, line_nr, buff);
1168 print_rr_weight (struct strbuf *buff, long v)
1172 if (v == RR_WEIGHT_PRIO)
1173 return append_strbuf_quoted(buff, "priorities");
1174 if (v == RR_WEIGHT_NONE)
1175 return append_strbuf_quoted(buff, "uniform");
1180 declare_def_handler(rr_weight, set_rr_weight)
1181 declare_def_snprint_defint(rr_weight, print_rr_weight, DEFAULT_RR_WEIGHT)
1182 declare_ovr_handler(rr_weight, set_rr_weight)
1183 declare_ovr_snprint(rr_weight, print_rr_weight)
1184 declare_hw_handler(rr_weight, set_rr_weight)
1185 declare_hw_snprint(rr_weight, print_rr_weight)
1186 declare_mp_handler(rr_weight, set_rr_weight)
1187 declare_mp_snprint(rr_weight, print_rr_weight)
1190 set_pgfailback(vector strvec, void *ptr, const char *file, int line_nr)
1192 int *int_ptr = (int *)ptr;
1195 buff = set_value(strvec);
1199 if (strlen(buff) == 6 && !strcmp(buff, "manual"))
1200 *int_ptr = -FAILBACK_MANUAL;
1201 else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
1202 *int_ptr = -FAILBACK_IMMEDIATE;
1203 else if (strlen(buff) == 10 && !strcmp(buff, "followover"))
1204 *int_ptr = -FAILBACK_FOLLOWOVER;
1206 do_set_int(strvec, ptr, 0, INT_MAX, file, line_nr, buff);
1214 print_pgfailback (struct strbuf *buff, long v)
1217 case FAILBACK_UNDEF:
1219 case -FAILBACK_MANUAL:
1220 return append_strbuf_quoted(buff, "manual");
1221 case -FAILBACK_IMMEDIATE:
1222 return append_strbuf_quoted(buff, "immediate");
1223 case -FAILBACK_FOLLOWOVER:
1224 return append_strbuf_quoted(buff, "followover");
1226 return print_int(buff, v);
1230 declare_def_handler(pgfailback, set_pgfailback)
1231 declare_def_snprint_defint(pgfailback, print_pgfailback, DEFAULT_FAILBACK)
1232 declare_ovr_handler(pgfailback, set_pgfailback)
1233 declare_ovr_snprint(pgfailback, print_pgfailback)
1234 declare_hw_handler(pgfailback, set_pgfailback)
1235 declare_hw_snprint(pgfailback, print_pgfailback)
1236 declare_mp_handler(pgfailback, set_pgfailback)
1237 declare_mp_snprint(pgfailback, print_pgfailback)
1240 no_path_retry_helper(vector strvec, void *ptr, const char *file, int line_nr)
1242 int *int_ptr = (int *)ptr;
1245 buff = set_value(strvec);
1249 if (!strcmp(buff, "fail") || !strcmp(buff, "0"))
1250 *int_ptr = NO_PATH_RETRY_FAIL;
1251 else if (!strcmp(buff, "queue"))
1252 *int_ptr = NO_PATH_RETRY_QUEUE;
1254 do_set_int(strvec, ptr, 1, INT_MAX, file, line_nr, buff);
1261 print_no_path_retry(struct strbuf *buff, long v)
1264 case NO_PATH_RETRY_UNDEF:
1266 case NO_PATH_RETRY_FAIL:
1267 return append_strbuf_quoted(buff, "fail");
1268 case NO_PATH_RETRY_QUEUE:
1269 return append_strbuf_quoted(buff, "queue");
1271 return print_int(buff, v);
1275 declare_def_handler(no_path_retry, no_path_retry_helper)
1276 declare_def_snprint(no_path_retry, print_no_path_retry)
1277 declare_ovr_handler(no_path_retry, no_path_retry_helper)
1278 declare_ovr_snprint(no_path_retry, print_no_path_retry)
1279 declare_hw_handler(no_path_retry, no_path_retry_helper)
1280 declare_hw_snprint(no_path_retry, print_no_path_retry)
1281 declare_mp_handler(no_path_retry, no_path_retry_helper)
1282 declare_mp_snprint(no_path_retry, print_no_path_retry)
1285 def_log_checker_err_handler(struct config *conf, vector strvec,
1286 const char *file, int line_nr)
1290 buff = set_value(strvec);
1295 if (!strcmp(buff, "once"))
1296 conf->log_checker_err = LOG_CHKR_ERR_ONCE;
1297 else if (!strcmp(buff, "always"))
1298 conf->log_checker_err = LOG_CHKR_ERR_ALWAYS;
1300 condlog(1, "%s line %d, invalid value for log_checker_err: \"%s\"",
1301 file, line_nr, buff);
1308 snprint_def_log_checker_err(struct config *conf, struct strbuf *buff,
1311 if (conf->log_checker_err == LOG_CHKR_ERR_ONCE)
1312 return append_strbuf_quoted(buff, "once");
1313 return append_strbuf_quoted(buff, "always");
1317 set_reservation_key(vector strvec, struct be64 *be64_ptr, uint8_t *flags_ptr,
1324 buff = set_value(strvec);
1328 if (strcmp(buff, "file") == 0) {
1329 *source_ptr = PRKEY_SOURCE_FILE;
1331 put_be64(*be64_ptr, 0);
1336 if (parse_prkey_flags(buff, &prkey, &sa_flags) != 0) {
1340 *source_ptr = PRKEY_SOURCE_CONF;
1341 *flags_ptr = sa_flags;
1342 put_be64(*be64_ptr, prkey);
1348 print_reservation_key(struct strbuf *buff,
1349 struct be64 key, uint8_t flags, int source)
1352 if (source == PRKEY_SOURCE_NONE)
1354 if (source == PRKEY_SOURCE_FILE)
1355 return append_strbuf_quoted(buff, "file");
1356 if (flags & MPATH_F_APTPL_MASK)
1358 return print_strbuf(buff, "0x%" PRIx64 "%s", get_be64(key), flagstr);
1362 def_reservation_key_handler(struct config *conf, vector strvec,
1363 const char *file, int line_nr)
1365 return set_reservation_key(strvec, &conf->reservation_key,
1367 &conf->prkey_source);
1371 snprint_def_reservation_key (struct config *conf, struct strbuf *buff,
1374 return print_reservation_key(buff, conf->reservation_key,
1375 conf->sa_flags, conf->prkey_source);
1379 mp_reservation_key_handler(struct config *conf, vector strvec, const char *file,
1382 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1385 return set_reservation_key(strvec, &mpe->reservation_key,
1387 &mpe->prkey_source);
1391 snprint_mp_reservation_key (struct config *conf, struct strbuf *buff,
1394 const struct mpentry * mpe = (const struct mpentry *)data;
1395 return print_reservation_key(buff, mpe->reservation_key,
1396 mpe->sa_flags, mpe->prkey_source);
1400 set_off_int_undef(vector strvec, void *ptr, const char *file, int line_nr)
1402 int *int_ptr = (int *)ptr;
1405 buff = set_value(strvec);
1409 if (!strcmp(buff, "no") || !strcmp(buff, "0"))
1412 do_set_int(strvec, ptr, 1, INT_MAX, file, line_nr, buff);
1419 print_off_int_undef(struct strbuf *buff, long v)
1425 return append_strbuf_quoted(buff, "no");
1427 return print_int(buff, v);
1431 declare_def_handler(delay_watch_checks, set_off_int_undef)
1432 declare_def_snprint_defint(delay_watch_checks, print_off_int_undef,
1433 DEFAULT_DELAY_CHECKS)
1434 declare_ovr_handler(delay_watch_checks, set_off_int_undef)
1435 declare_ovr_snprint(delay_watch_checks, print_off_int_undef)
1436 declare_hw_handler(delay_watch_checks, set_off_int_undef)
1437 declare_hw_snprint(delay_watch_checks, print_off_int_undef)
1438 declare_mp_handler(delay_watch_checks, set_off_int_undef)
1439 declare_mp_snprint(delay_watch_checks, print_off_int_undef)
1440 declare_def_handler(delay_wait_checks, set_off_int_undef)
1441 declare_def_snprint_defint(delay_wait_checks, print_off_int_undef,
1442 DEFAULT_DELAY_CHECKS)
1443 declare_ovr_handler(delay_wait_checks, set_off_int_undef)
1444 declare_ovr_snprint(delay_wait_checks, print_off_int_undef)
1445 declare_hw_handler(delay_wait_checks, set_off_int_undef)
1446 declare_hw_snprint(delay_wait_checks, print_off_int_undef)
1447 declare_mp_handler(delay_wait_checks, set_off_int_undef)
1448 declare_mp_snprint(delay_wait_checks, print_off_int_undef)
1449 declare_def_handler(san_path_err_threshold, set_off_int_undef)
1450 declare_def_snprint_defint(san_path_err_threshold, print_off_int_undef,
1452 declare_ovr_handler(san_path_err_threshold, set_off_int_undef)
1453 declare_ovr_snprint(san_path_err_threshold, print_off_int_undef)
1454 declare_hw_handler(san_path_err_threshold, set_off_int_undef)
1455 declare_hw_snprint(san_path_err_threshold, print_off_int_undef)
1456 declare_mp_handler(san_path_err_threshold, set_off_int_undef)
1457 declare_mp_snprint(san_path_err_threshold, print_off_int_undef)
1458 declare_def_handler(san_path_err_forget_rate, set_off_int_undef)
1459 declare_def_snprint_defint(san_path_err_forget_rate, print_off_int_undef,
1461 declare_ovr_handler(san_path_err_forget_rate, set_off_int_undef)
1462 declare_ovr_snprint(san_path_err_forget_rate, print_off_int_undef)
1463 declare_hw_handler(san_path_err_forget_rate, set_off_int_undef)
1464 declare_hw_snprint(san_path_err_forget_rate, print_off_int_undef)
1465 declare_mp_handler(san_path_err_forget_rate, set_off_int_undef)
1466 declare_mp_snprint(san_path_err_forget_rate, print_off_int_undef)
1467 declare_def_handler(san_path_err_recovery_time, set_off_int_undef)
1468 declare_def_snprint_defint(san_path_err_recovery_time, print_off_int_undef,
1470 declare_ovr_handler(san_path_err_recovery_time, set_off_int_undef)
1471 declare_ovr_snprint(san_path_err_recovery_time, print_off_int_undef)
1472 declare_hw_handler(san_path_err_recovery_time, set_off_int_undef)
1473 declare_hw_snprint(san_path_err_recovery_time, print_off_int_undef)
1474 declare_mp_handler(san_path_err_recovery_time, set_off_int_undef)
1475 declare_mp_snprint(san_path_err_recovery_time, print_off_int_undef)
1476 declare_def_handler(marginal_path_err_sample_time, set_off_int_undef)
1477 declare_def_snprint_defint(marginal_path_err_sample_time, print_off_int_undef,
1479 declare_ovr_handler(marginal_path_err_sample_time, set_off_int_undef)
1480 declare_ovr_snprint(marginal_path_err_sample_time, print_off_int_undef)
1481 declare_hw_handler(marginal_path_err_sample_time, set_off_int_undef)
1482 declare_hw_snprint(marginal_path_err_sample_time, print_off_int_undef)
1483 declare_mp_handler(marginal_path_err_sample_time, set_off_int_undef)
1484 declare_mp_snprint(marginal_path_err_sample_time, print_off_int_undef)
1485 declare_def_handler(marginal_path_err_rate_threshold, set_off_int_undef)
1486 declare_def_snprint_defint(marginal_path_err_rate_threshold, print_off_int_undef,
1488 declare_ovr_handler(marginal_path_err_rate_threshold, set_off_int_undef)
1489 declare_ovr_snprint(marginal_path_err_rate_threshold, print_off_int_undef)
1490 declare_hw_handler(marginal_path_err_rate_threshold, set_off_int_undef)
1491 declare_hw_snprint(marginal_path_err_rate_threshold, print_off_int_undef)
1492 declare_mp_handler(marginal_path_err_rate_threshold, set_off_int_undef)
1493 declare_mp_snprint(marginal_path_err_rate_threshold, print_off_int_undef)
1494 declare_def_handler(marginal_path_err_recheck_gap_time, set_off_int_undef)
1495 declare_def_snprint_defint(marginal_path_err_recheck_gap_time, print_off_int_undef,
1497 declare_ovr_handler(marginal_path_err_recheck_gap_time, set_off_int_undef)
1498 declare_ovr_snprint(marginal_path_err_recheck_gap_time, print_off_int_undef)
1499 declare_hw_handler(marginal_path_err_recheck_gap_time, set_off_int_undef)
1500 declare_hw_snprint(marginal_path_err_recheck_gap_time, print_off_int_undef)
1501 declare_mp_handler(marginal_path_err_recheck_gap_time, set_off_int_undef)
1502 declare_mp_snprint(marginal_path_err_recheck_gap_time, print_off_int_undef)
1503 declare_def_handler(marginal_path_double_failed_time, set_off_int_undef)
1504 declare_def_snprint_defint(marginal_path_double_failed_time, print_off_int_undef,
1506 declare_ovr_handler(marginal_path_double_failed_time, set_off_int_undef)
1507 declare_ovr_snprint(marginal_path_double_failed_time, print_off_int_undef)
1508 declare_hw_handler(marginal_path_double_failed_time, set_off_int_undef)
1509 declare_hw_snprint(marginal_path_double_failed_time, print_off_int_undef)
1510 declare_mp_handler(marginal_path_double_failed_time, set_off_int_undef)
1511 declare_mp_snprint(marginal_path_double_failed_time, print_off_int_undef)
1513 declare_def_handler(ghost_delay, set_off_int_undef)
1514 declare_def_snprint(ghost_delay, print_off_int_undef)
1515 declare_ovr_handler(ghost_delay, set_off_int_undef)
1516 declare_ovr_snprint(ghost_delay, print_off_int_undef)
1517 declare_hw_handler(ghost_delay, set_off_int_undef)
1518 declare_hw_snprint(ghost_delay, print_off_int_undef)
1519 declare_mp_handler(ghost_delay, set_off_int_undef)
1520 declare_mp_snprint(ghost_delay, print_off_int_undef)
1522 declare_def_handler(all_tg_pt, set_yes_no_undef)
1523 declare_def_snprint_defint(all_tg_pt, print_yes_no_undef, DEFAULT_ALL_TG_PT)
1524 declare_ovr_handler(all_tg_pt, set_yes_no_undef)
1525 declare_ovr_snprint(all_tg_pt, print_yes_no_undef)
1526 declare_hw_handler(all_tg_pt, set_yes_no_undef)
1527 declare_hw_snprint(all_tg_pt, print_yes_no_undef)
1529 declare_def_handler(marginal_pathgroups, set_yes_no)
1530 declare_def_snprint(marginal_pathgroups, print_yes_no)
1532 declare_def_handler(recheck_wwid, set_yes_no_undef)
1533 declare_def_snprint_defint(recheck_wwid, print_yes_no_undef, DEFAULT_RECHECK_WWID)
1534 declare_ovr_handler(recheck_wwid, set_yes_no_undef)
1535 declare_ovr_snprint(recheck_wwid, print_yes_no_undef)
1536 declare_hw_handler(recheck_wwid, set_yes_no_undef)
1537 declare_hw_snprint(recheck_wwid, print_yes_no_undef)
1539 declare_def_range_handler(uxsock_timeout, DEFAULT_REPLY_TIMEOUT, INT_MAX)
1542 hw_vpd_vendor_handler(struct config *conf, vector strvec, const char *file,
1548 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1552 buff = set_value(strvec);
1555 for (i = 0; i < VPD_VP_ARRAY_SIZE; i++) {
1556 if (strcmp(buff, vpd_vendor_pages[i].name) == 0) {
1557 hwe->vpd_vendor_id = i;
1561 condlog(1, "%s line %d, invalid value for vpd_vendor: \"%s\"",
1562 file, line_nr, buff);
1569 snprint_hw_vpd_vendor(struct config *conf, struct strbuf *buff,
1572 const struct hwentry * hwe = (const struct hwentry *)data;
1574 if (hwe->vpd_vendor_id > 0 && hwe->vpd_vendor_id < VPD_VP_ARRAY_SIZE)
1575 return append_strbuf_quoted(buff,
1576 vpd_vendor_pages[hwe->vpd_vendor_id].name);
1581 * blacklist block handlers
1584 blacklist_handler(struct config *conf, vector strvec, const char*file,
1587 if (!conf->blist_devnode)
1588 conf->blist_devnode = vector_alloc();
1589 if (!conf->blist_wwid)
1590 conf->blist_wwid = vector_alloc();
1591 if (!conf->blist_device)
1592 conf->blist_device = vector_alloc();
1593 if (!conf->blist_property)
1594 conf->blist_property = vector_alloc();
1595 if (!conf->blist_protocol)
1596 conf->blist_protocol = vector_alloc();
1598 if (!conf->blist_devnode || !conf->blist_wwid ||
1599 !conf->blist_device || !conf->blist_property ||
1600 !conf->blist_protocol)
1607 blacklist_exceptions_handler(struct config *conf, vector strvec,
1608 const char *file, int line_nr)
1610 if (!conf->elist_devnode)
1611 conf->elist_devnode = vector_alloc();
1612 if (!conf->elist_wwid)
1613 conf->elist_wwid = vector_alloc();
1614 if (!conf->elist_device)
1615 conf->elist_device = vector_alloc();
1616 if (!conf->elist_property)
1617 conf->elist_property = vector_alloc();
1618 if (!conf->elist_protocol)
1619 conf->elist_protocol = vector_alloc();
1621 if (!conf->elist_devnode || !conf->elist_wwid ||
1622 !conf->elist_device || !conf->elist_property ||
1623 !conf->elist_protocol)
1629 #define declare_ble_handler(option) \
1631 ble_ ## option ## _handler (struct config *conf, vector strvec, \
1632 const char *file, int line_nr) \
1637 if (!conf->option) \
1640 buff = set_value(strvec); \
1644 rc = store_ble(conf->option, buff, ORIGIN_CONFIG); \
1649 #define declare_ble_device_handler(name, option, vend, prod) \
1651 ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec, \
1652 const char *file, int line_nr) \
1657 if (!conf->option) \
1660 buff = set_value(strvec); \
1664 rc = set_ble_device(conf->option, vend, prod, ORIGIN_CONFIG); \
1669 declare_ble_handler(blist_devnode)
1670 declare_ble_handler(elist_devnode)
1671 declare_ble_handler(blist_wwid)
1672 declare_ble_handler(elist_wwid)
1673 declare_ble_handler(blist_property)
1674 declare_ble_handler(elist_property)
1675 declare_ble_handler(blist_protocol)
1676 declare_ble_handler(elist_protocol)
1679 snprint_def_uxsock_timeout(struct config *conf, struct strbuf *buff,
1682 return print_strbuf(buff, "%u", conf->uxsock_timeout);
1686 snprint_ble_simple (struct config *conf, struct strbuf *buff, const void *data)
1688 const struct blentry *ble = (const struct blentry *)data;
1690 return print_str(buff, ble->str);
1694 ble_device_handler(struct config *conf, vector strvec, const char *file,
1697 return alloc_ble_device(conf->blist_device);
1701 ble_except_device_handler(struct config *conf, vector strvec, const char *file,
1704 return alloc_ble_device(conf->elist_device);
1707 declare_ble_device_handler(vendor, blist_device, buff, NULL)
1708 declare_ble_device_handler(vendor, elist_device, buff, NULL)
1709 declare_ble_device_handler(product, blist_device, NULL, buff)
1710 declare_ble_device_handler(product, elist_device, NULL, buff)
1712 static int snprint_bled_vendor(struct config *conf, struct strbuf *buff,
1715 const struct blentry_device * bled =
1716 (const struct blentry_device *)data;
1718 return print_str(buff, bled->vendor);
1721 static int snprint_bled_product(struct config *conf, struct strbuf *buff,
1724 const struct blentry_device * bled =
1725 (const struct blentry_device *)data;
1727 return print_str(buff, bled->product);
1731 * devices block handlers
1734 devices_handler(struct config *conf, vector strvec, const char *file,
1738 conf->hwtable = vector_alloc();
1747 device_handler(struct config *conf, vector strvec, const char *file,
1750 struct hwentry * hwe;
1757 if (!vector_alloc_slot(conf->hwtable)) {
1761 vector_set_slot(conf->hwtable, hwe);
1766 declare_hw_handler(vendor, set_str)
1767 declare_hw_snprint(vendor, print_str)
1769 declare_hw_handler(product, set_str)
1770 declare_hw_snprint(product, print_str)
1772 declare_hw_handler(revision, set_str)
1773 declare_hw_snprint(revision, print_str)
1775 declare_hw_handler(bl_product, set_str)
1776 declare_hw_snprint(bl_product, print_str)
1778 declare_hw_handler(hwhandler, set_str)
1779 declare_hw_snprint(hwhandler, print_str)
1782 * overrides handlers
1785 overrides_handler(struct config *conf, vector strvec, const char *file,
1788 if (!conf->overrides)
1789 conf->overrides = alloc_hwe();
1791 if (!conf->overrides)
1800 * multipaths block handlers
1803 multipaths_handler(struct config *conf, vector strvec, const char *file,
1807 conf->mptable = vector_alloc();
1816 multipath_handler(struct config *conf, vector strvec, const char *file,
1819 struct mpentry * mpe;
1826 if (!vector_alloc_slot(conf->mptable)) {
1830 vector_set_slot(conf->mptable, mpe);
1835 declare_mp_handler(wwid, set_str)
1836 declare_mp_snprint(wwid, print_str)
1838 declare_mp_handler(alias, set_str_noslash)
1839 declare_mp_snprint(alias, print_str)
1842 * deprecated handlers
1846 deprecated_handler(struct config *conf, vector strvec, const char *file,
1851 buff = set_value(strvec);
1861 snprint_deprecated (struct config *conf, struct strbuf *buff, const void * data)
1866 #define __deprecated
1869 * If you add or remove a keyword also update multipath/multipath.conf.5
1872 init_keywords(vector keywords)
1874 install_keyword_root("defaults", NULL);
1875 install_keyword("verbosity", &def_verbosity_handler, &snprint_def_verbosity);
1876 install_keyword("polling_interval", &checkint_handler, &snprint_def_checkint);
1877 install_keyword("max_polling_interval", &def_max_checkint_handler, &snprint_def_max_checkint);
1878 install_keyword("reassign_maps", &def_reassign_maps_handler, &snprint_def_reassign_maps);
1879 install_keyword("multipath_dir", &def_multipath_dir_handler, &snprint_def_multipath_dir);
1880 install_keyword("path_selector", &def_selector_handler, &snprint_def_selector);
1881 install_keyword("path_grouping_policy", &def_pgpolicy_handler, &snprint_def_pgpolicy);
1882 install_keyword("uid_attrs", &uid_attrs_handler, &snprint_uid_attrs);
1883 install_keyword("uid_attribute", &def_uid_attribute_handler, &snprint_def_uid_attribute);
1884 install_keyword("getuid_callout", &def_getuid_handler, &snprint_def_getuid);
1885 install_keyword("prio", &def_prio_name_handler, &snprint_def_prio_name);
1886 install_keyword("prio_args", &def_prio_args_handler, &snprint_def_prio_args);
1887 install_keyword("features", &def_features_handler, &snprint_def_features);
1888 install_keyword("path_checker", &def_checker_name_handler, &snprint_def_checker_name);
1889 install_keyword("checker", &def_checker_name_handler, NULL);
1890 install_keyword("alias_prefix", &def_alias_prefix_handler, &snprint_def_alias_prefix);
1891 install_keyword("failback", &def_pgfailback_handler, &snprint_def_pgfailback);
1892 install_keyword("rr_min_io", &def_minio_handler, &snprint_def_minio);
1893 install_keyword("rr_min_io_rq", &def_minio_rq_handler, &snprint_def_minio_rq);
1894 install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
1895 install_keyword("rr_weight", &def_rr_weight_handler, &snprint_def_rr_weight);
1896 install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
1897 install_keyword("queue_without_daemon", &def_queue_without_daemon_handler, &snprint_def_queue_without_daemon);
1898 install_keyword("checker_timeout", &def_checker_timeout_handler, &snprint_def_checker_timeout);
1899 install_keyword("allow_usb_devices", &def_allow_usb_devices_handler, &snprint_def_allow_usb_devices);
1900 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
1901 install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
1902 install_keyword("user_friendly_names", &def_user_friendly_names_handler, &snprint_def_user_friendly_names);
1903 install_keyword("mode", &def_mode_handler, &snprint_def_mode);
1904 install_keyword("uid", &def_uid_handler, &snprint_def_uid);
1905 install_keyword("gid", &def_gid_handler, &snprint_def_gid);
1906 install_keyword("fast_io_fail_tmo", &def_fast_io_fail_handler, &snprint_def_fast_io_fail);
1907 install_keyword("dev_loss_tmo", &def_dev_loss_handler, &snprint_def_dev_loss);
1908 install_keyword("eh_deadline", &def_eh_deadline_handler, &snprint_def_eh_deadline);
1909 install_keyword("bindings_file", &def_bindings_file_handler, &snprint_def_bindings_file);
1910 install_keyword("wwids_file", &def_wwids_file_handler, &snprint_def_wwids_file);
1911 install_keyword("prkeys_file", &def_prkeys_file_handler, &snprint_def_prkeys_file);
1912 install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
1913 install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
1914 install_keyword("all_tg_pt", &def_all_tg_pt_handler, &snprint_def_all_tg_pt);
1915 install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler);
1916 install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
1917 install_keyword("detect_checker", &def_detect_checker_handler, &snprint_def_detect_checker);
1918 install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync);
1919 install_keyword("strict_timing", &def_strict_timing_handler, &snprint_def_strict_timing);
1920 install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove);
1921 install_keyword("partition_delimiter", &def_partition_delim_handler, &snprint_def_partition_delim);
1922 install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir);
1923 install_keyword("delay_watch_checks", &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks);
1924 install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks);
1925 install_keyword("san_path_err_threshold", &def_san_path_err_threshold_handler, &snprint_def_san_path_err_threshold);
1926 install_keyword("san_path_err_forget_rate", &def_san_path_err_forget_rate_handler, &snprint_def_san_path_err_forget_rate);
1927 install_keyword("san_path_err_recovery_time", &def_san_path_err_recovery_time_handler, &snprint_def_san_path_err_recovery_time);
1928 install_keyword("marginal_path_err_sample_time", &def_marginal_path_err_sample_time_handler, &snprint_def_marginal_path_err_sample_time);
1929 install_keyword("marginal_path_err_rate_threshold", &def_marginal_path_err_rate_threshold_handler, &snprint_def_marginal_path_err_rate_threshold);
1930 install_keyword("marginal_path_err_recheck_gap_time", &def_marginal_path_err_recheck_gap_time_handler, &snprint_def_marginal_path_err_recheck_gap_time);
1931 install_keyword("marginal_path_double_failed_time", &def_marginal_path_double_failed_time_handler, &snprint_def_marginal_path_double_failed_time);
1933 install_keyword("find_multipaths", &def_find_multipaths_handler, &snprint_def_find_multipaths);
1934 install_keyword("uxsock_timeout", &def_uxsock_timeout_handler, &snprint_def_uxsock_timeout);
1935 install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries);
1936 install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay);
1937 install_keyword("missing_uev_wait_timeout", &def_uev_wait_timeout_handler, &snprint_def_uev_wait_timeout);
1938 install_keyword("skip_kpartx", &def_skip_kpartx_handler, &snprint_def_skip_kpartx);
1939 install_keyword("disable_changed_wwids", &def_disable_changed_wwids_handler, &snprint_def_disable_changed_wwids);
1940 install_keyword("remove_retries", &def_remove_retries_handler, &snprint_def_remove_retries);
1941 install_keyword("max_sectors_kb", &def_max_sectors_kb_handler, &snprint_def_max_sectors_kb);
1942 install_keyword("ghost_delay", &def_ghost_delay_handler, &snprint_def_ghost_delay);
1943 install_keyword("find_multipaths_timeout",
1944 &def_find_multipaths_timeout_handler,
1945 &snprint_def_find_multipaths_timeout);
1946 install_keyword("enable_foreign", &def_enable_foreign_handler,
1947 &snprint_def_enable_foreign);
1948 install_keyword("marginal_pathgroups", &def_marginal_pathgroups_handler, &snprint_def_marginal_pathgroups);
1949 install_keyword("recheck_wwid", &def_recheck_wwid_handler, &snprint_def_recheck_wwid);
1950 __deprecated install_keyword("default_selector", &def_selector_handler, NULL);
1951 __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
1952 __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
1953 __deprecated install_keyword("default_getuid_callout", &def_getuid_handler, NULL);
1954 __deprecated install_keyword("default_features", &def_features_handler, NULL);
1955 __deprecated install_keyword("default_path_checker", &def_checker_name_handler, NULL);
1957 install_keyword_root("blacklist", &blacklist_handler);
1958 install_keyword_multi("devnode", &ble_blist_devnode_handler, &snprint_ble_simple);
1959 install_keyword_multi("wwid", &ble_blist_wwid_handler, &snprint_ble_simple);
1960 install_keyword_multi("property", &ble_blist_property_handler, &snprint_ble_simple);
1961 install_keyword_multi("protocol", &ble_blist_protocol_handler, &snprint_ble_simple);
1962 install_keyword_multi("device", &ble_device_handler, NULL);
1964 install_keyword("vendor", &ble_blist_device_vendor_handler, &snprint_bled_vendor);
1965 install_keyword("product", &ble_blist_device_product_handler, &snprint_bled_product);
1966 install_sublevel_end();
1967 install_keyword_root("blacklist_exceptions", &blacklist_exceptions_handler);
1968 install_keyword_multi("devnode", &ble_elist_devnode_handler, &snprint_ble_simple);
1969 install_keyword_multi("wwid", &ble_elist_wwid_handler, &snprint_ble_simple);
1970 install_keyword_multi("property", &ble_elist_property_handler, &snprint_ble_simple);
1971 install_keyword_multi("protocol", &ble_elist_protocol_handler, &snprint_ble_simple);
1972 install_keyword_multi("device", &ble_except_device_handler, NULL);
1974 install_keyword("vendor", &ble_elist_device_vendor_handler, &snprint_bled_vendor);
1975 install_keyword("product", &ble_elist_device_product_handler, &snprint_bled_product);
1976 install_sublevel_end();
1979 __deprecated install_keyword_root("devnode_blacklist", &blacklist_handler);
1980 __deprecated install_keyword("devnode", &ble_devnode_handler, &snprint_ble_simple);
1981 __deprecated install_keyword("wwid", &ble_wwid_handler, &snprint_ble_simple);
1982 __deprecated install_keyword("device", &ble_device_handler, NULL);
1983 __deprecated install_sublevel();
1984 __deprecated install_keyword("vendor", &ble_vendor_handler, &snprint_bled_vendor);
1985 __deprecated install_keyword("product", &ble_product_handler, &snprint_bled_product);
1986 __deprecated install_sublevel_end();
1989 * If you add or remove a "device subsection" keyword also update
1990 * multipath/multipath.conf.5 and the TEMPLATE in libmultipath/hwtable.c
1992 install_keyword_root("devices", &devices_handler);
1993 install_keyword_multi("device", &device_handler, NULL);
1995 install_keyword("vendor", &hw_vendor_handler, &snprint_hw_vendor);
1996 install_keyword("product", &hw_product_handler, &snprint_hw_product);
1997 install_keyword("revision", &hw_revision_handler, &snprint_hw_revision);
1998 install_keyword("product_blacklist", &hw_bl_product_handler, &snprint_hw_bl_product);
1999 install_keyword("path_grouping_policy", &hw_pgpolicy_handler, &snprint_hw_pgpolicy);
2000 install_keyword("uid_attribute", &hw_uid_attribute_handler, &snprint_hw_uid_attribute);
2001 install_keyword("getuid_callout", &hw_getuid_handler, &snprint_hw_getuid);
2002 install_keyword("path_selector", &hw_selector_handler, &snprint_hw_selector);
2003 install_keyword("path_checker", &hw_checker_name_handler, &snprint_hw_checker_name);
2004 install_keyword("checker", &hw_checker_name_handler, NULL);
2005 install_keyword("alias_prefix", &hw_alias_prefix_handler, &snprint_hw_alias_prefix);
2006 install_keyword("features", &hw_features_handler, &snprint_hw_features);
2007 install_keyword("hardware_handler", &hw_hwhandler_handler, &snprint_hw_hwhandler);
2008 install_keyword("prio", &hw_prio_name_handler, &snprint_hw_prio_name);
2009 install_keyword("prio_args", &hw_prio_args_handler, &snprint_hw_prio_args);
2010 install_keyword("failback", &hw_pgfailback_handler, &snprint_hw_pgfailback);
2011 install_keyword("rr_weight", &hw_rr_weight_handler, &snprint_hw_rr_weight);
2012 install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
2013 install_keyword("rr_min_io", &hw_minio_handler, &snprint_hw_minio);
2014 install_keyword("rr_min_io_rq", &hw_minio_rq_handler, &snprint_hw_minio_rq);
2015 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
2016 install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler, &snprint_hw_flush_on_last_del);
2017 install_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
2018 install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
2019 install_keyword("eh_deadline", &hw_eh_deadline_handler, &snprint_hw_eh_deadline);
2020 install_keyword("user_friendly_names", &hw_user_friendly_names_handler, &snprint_hw_user_friendly_names);
2021 install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler);
2022 install_keyword("detect_prio", &hw_detect_prio_handler, &snprint_hw_detect_prio);
2023 install_keyword("detect_checker", &hw_detect_checker_handler, &snprint_hw_detect_checker);
2024 install_keyword("deferred_remove", &hw_deferred_remove_handler, &snprint_hw_deferred_remove);
2025 install_keyword("delay_watch_checks", &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks);
2026 install_keyword("delay_wait_checks", &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks);
2027 install_keyword("san_path_err_threshold", &hw_san_path_err_threshold_handler, &snprint_hw_san_path_err_threshold);
2028 install_keyword("san_path_err_forget_rate", &hw_san_path_err_forget_rate_handler, &snprint_hw_san_path_err_forget_rate);
2029 install_keyword("san_path_err_recovery_time", &hw_san_path_err_recovery_time_handler, &snprint_hw_san_path_err_recovery_time);
2030 install_keyword("marginal_path_err_sample_time", &hw_marginal_path_err_sample_time_handler, &snprint_hw_marginal_path_err_sample_time);
2031 install_keyword("marginal_path_err_rate_threshold", &hw_marginal_path_err_rate_threshold_handler, &snprint_hw_marginal_path_err_rate_threshold);
2032 install_keyword("marginal_path_err_recheck_gap_time", &hw_marginal_path_err_recheck_gap_time_handler, &snprint_hw_marginal_path_err_recheck_gap_time);
2033 install_keyword("marginal_path_double_failed_time", &hw_marginal_path_double_failed_time_handler, &snprint_hw_marginal_path_double_failed_time);
2034 install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx);
2035 install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb);
2036 install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay);
2037 install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt);
2038 install_keyword("vpd_vendor", &hw_vpd_vendor_handler, &snprint_hw_vpd_vendor);
2039 install_keyword("recheck_wwid", &hw_recheck_wwid_handler, &snprint_hw_recheck_wwid);
2040 install_sublevel_end();
2042 install_keyword_root("overrides", &overrides_handler);
2043 install_keyword("path_grouping_policy", &ovr_pgpolicy_handler, &snprint_ovr_pgpolicy);
2044 install_keyword("uid_attribute", &ovr_uid_attribute_handler, &snprint_ovr_uid_attribute);
2045 install_keyword("getuid_callout", &ovr_getuid_handler, &snprint_ovr_getuid);
2046 install_keyword("path_selector", &ovr_selector_handler, &snprint_ovr_selector);
2047 install_keyword("path_checker", &ovr_checker_name_handler, &snprint_ovr_checker_name);
2048 install_keyword("checker", &ovr_checker_name_handler, NULL);
2049 install_keyword("alias_prefix", &ovr_alias_prefix_handler, &snprint_ovr_alias_prefix);
2050 install_keyword("features", &ovr_features_handler, &snprint_ovr_features);
2051 install_keyword("prio", &ovr_prio_name_handler, &snprint_ovr_prio_name);
2052 install_keyword("prio_args", &ovr_prio_args_handler, &snprint_ovr_prio_args);
2053 install_keyword("failback", &ovr_pgfailback_handler, &snprint_ovr_pgfailback);
2054 install_keyword("rr_weight", &ovr_rr_weight_handler, &snprint_ovr_rr_weight);
2055 install_keyword("no_path_retry", &ovr_no_path_retry_handler, &snprint_ovr_no_path_retry);
2056 install_keyword("rr_min_io", &ovr_minio_handler, &snprint_ovr_minio);
2057 install_keyword("rr_min_io_rq", &ovr_minio_rq_handler, &snprint_ovr_minio_rq);
2058 install_keyword("flush_on_last_del", &ovr_flush_on_last_del_handler, &snprint_ovr_flush_on_last_del);
2059 install_keyword("fast_io_fail_tmo", &ovr_fast_io_fail_handler, &snprint_ovr_fast_io_fail);
2060 install_keyword("dev_loss_tmo", &ovr_dev_loss_handler, &snprint_ovr_dev_loss);
2061 install_keyword("eh_deadline", &ovr_eh_deadline_handler, &snprint_ovr_eh_deadline);
2062 install_keyword("user_friendly_names", &ovr_user_friendly_names_handler, &snprint_ovr_user_friendly_names);
2063 install_keyword("retain_attached_hw_handler", &ovr_retain_hwhandler_handler, &snprint_ovr_retain_hwhandler);
2064 install_keyword("detect_prio", &ovr_detect_prio_handler, &snprint_ovr_detect_prio);
2065 install_keyword("detect_checker", &ovr_detect_checker_handler, &snprint_ovr_detect_checker);
2066 install_keyword("deferred_remove", &ovr_deferred_remove_handler, &snprint_ovr_deferred_remove);
2067 install_keyword("delay_watch_checks", &ovr_delay_watch_checks_handler, &snprint_ovr_delay_watch_checks);
2068 install_keyword("delay_wait_checks", &ovr_delay_wait_checks_handler, &snprint_ovr_delay_wait_checks);
2069 install_keyword("san_path_err_threshold", &ovr_san_path_err_threshold_handler, &snprint_ovr_san_path_err_threshold);
2070 install_keyword("san_path_err_forget_rate", &ovr_san_path_err_forget_rate_handler, &snprint_ovr_san_path_err_forget_rate);
2071 install_keyword("san_path_err_recovery_time", &ovr_san_path_err_recovery_time_handler, &snprint_ovr_san_path_err_recovery_time);
2072 install_keyword("marginal_path_err_sample_time", &ovr_marginal_path_err_sample_time_handler, &snprint_ovr_marginal_path_err_sample_time);
2073 install_keyword("marginal_path_err_rate_threshold", &ovr_marginal_path_err_rate_threshold_handler, &snprint_ovr_marginal_path_err_rate_threshold);
2074 install_keyword("marginal_path_err_recheck_gap_time", &ovr_marginal_path_err_recheck_gap_time_handler, &snprint_ovr_marginal_path_err_recheck_gap_time);
2075 install_keyword("marginal_path_double_failed_time", &ovr_marginal_path_double_failed_time_handler, &snprint_ovr_marginal_path_double_failed_time);
2077 install_keyword("skip_kpartx", &ovr_skip_kpartx_handler, &snprint_ovr_skip_kpartx);
2078 install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb);
2079 install_keyword("ghost_delay", &ovr_ghost_delay_handler, &snprint_ovr_ghost_delay);
2080 install_keyword("all_tg_pt", &ovr_all_tg_pt_handler, &snprint_ovr_all_tg_pt);
2081 install_keyword("recheck_wwid", &ovr_recheck_wwid_handler, &snprint_ovr_recheck_wwid);
2083 install_keyword_root("multipaths", &multipaths_handler);
2084 install_keyword_multi("multipath", &multipath_handler, NULL);
2086 install_keyword("wwid", &mp_wwid_handler, &snprint_mp_wwid);
2087 install_keyword("alias", &mp_alias_handler, &snprint_mp_alias);
2088 install_keyword("path_grouping_policy", &mp_pgpolicy_handler, &snprint_mp_pgpolicy);
2089 install_keyword("path_selector", &mp_selector_handler, &snprint_mp_selector);
2090 install_keyword("prio", &mp_prio_name_handler, &snprint_mp_prio_name);
2091 install_keyword("prio_args", &mp_prio_args_handler, &snprint_mp_prio_args);
2092 install_keyword("failback", &mp_pgfailback_handler, &snprint_mp_pgfailback);
2093 install_keyword("rr_weight", &mp_rr_weight_handler, &snprint_mp_rr_weight);
2094 install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
2095 install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_minio);
2096 install_keyword("rr_min_io_rq", &mp_minio_rq_handler, &snprint_mp_minio_rq);
2097 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
2098 install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
2099 install_keyword("features", &mp_features_handler, &snprint_mp_features);
2100 install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
2101 install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
2102 install_keyword("gid", &mp_gid_handler, &snprint_mp_gid);
2103 install_keyword("reservation_key", &mp_reservation_key_handler, &snprint_mp_reservation_key);
2104 install_keyword("user_friendly_names", &mp_user_friendly_names_handler, &snprint_mp_user_friendly_names);
2105 install_keyword("deferred_remove", &mp_deferred_remove_handler, &snprint_mp_deferred_remove);
2106 install_keyword("delay_watch_checks", &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks);
2107 install_keyword("delay_wait_checks", &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks);
2108 install_keyword("san_path_err_threshold", &mp_san_path_err_threshold_handler, &snprint_mp_san_path_err_threshold);
2109 install_keyword("san_path_err_forget_rate", &mp_san_path_err_forget_rate_handler, &snprint_mp_san_path_err_forget_rate);
2110 install_keyword("san_path_err_recovery_time", &mp_san_path_err_recovery_time_handler, &snprint_mp_san_path_err_recovery_time);
2111 install_keyword("marginal_path_err_sample_time", &mp_marginal_path_err_sample_time_handler, &snprint_mp_marginal_path_err_sample_time);
2112 install_keyword("marginal_path_err_rate_threshold", &mp_marginal_path_err_rate_threshold_handler, &snprint_mp_marginal_path_err_rate_threshold);
2113 install_keyword("marginal_path_err_recheck_gap_time", &mp_marginal_path_err_recheck_gap_time_handler, &snprint_mp_marginal_path_err_recheck_gap_time);
2114 install_keyword("marginal_path_double_failed_time", &mp_marginal_path_double_failed_time_handler, &snprint_mp_marginal_path_double_failed_time);
2115 install_keyword("skip_kpartx", &mp_skip_kpartx_handler, &snprint_mp_skip_kpartx);
2116 install_keyword("max_sectors_kb", &mp_max_sectors_kb_handler, &snprint_mp_max_sectors_kb);
2117 install_keyword("ghost_delay", &mp_ghost_delay_handler, &snprint_mp_ghost_delay);
2118 install_sublevel_end();