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
18 #include "pgpolicies.h"
19 #include "blacklist.h"
24 #include "mpath_cmd.h"
27 set_int(vector strvec, void *ptr)
29 int *int_ptr = (int *)ptr;
32 buff = VECTOR_SLOT(strvec, 1);
33 *int_ptr = atoi(buff);
39 set_str(vector strvec, void *ptr)
41 char **str_ptr = (char **)ptr;
45 *str_ptr = set_value(strvec);
54 set_yes_no(vector strvec, void *ptr)
57 int *int_ptr = (int *)ptr;
59 buff = set_value(strvec);
63 if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0)
73 set_yes_no_undef(vector strvec, void *ptr)
76 int *int_ptr = (int *)ptr;
78 buff = set_value(strvec);
82 if (strcmp(buff, "no") == 0 || strcmp(buff, "0") == 0)
84 else if (strcmp(buff, "yes") == 0 || strcmp(buff, "1") == 0)
94 print_int (char *buff, int len, void *ptr)
96 int *int_ptr = (int *)ptr;
97 return snprintf(buff, len, "%i", *int_ptr);
101 print_nonzero (char *buff, int len, void *ptr)
103 int *int_ptr = (int *)ptr;
106 return snprintf(buff, len, "%i", *int_ptr);
110 print_str (char *buff, int len, void *ptr)
112 char **str_ptr = (char **)ptr;
115 return snprintf(buff, len, "\"%s\"", *str_ptr);
119 print_yes_no (char *buff, int len, void *ptr)
121 int *int_ptr = (int *)ptr;
122 return snprintf(buff, len, "\"%s\"",
123 (*int_ptr == YN_NO)? "no" : "yes");
127 print_yes_no_undef (char *buff, int len, void *ptr)
129 int *int_ptr = (int *)ptr;
132 return snprintf(buff, len, "\"%s\"",
133 (*int_ptr == YNU_NO)? "no" : "yes");
136 #define declare_def_handler(option, function) \
138 def_ ## option ## _handler (struct config *conf, vector strvec) \
140 return function (strvec, &conf->option); \
143 #define declare_def_snprint(option, function) \
145 snprint_def_ ## option (struct config *conf, char * buff, int len, void * data) \
147 return function (buff, len, &conf->option); \
150 #define declare_def_snprint_defint(option, function, value) \
152 snprint_def_ ## option (struct config *conf, char * buff, int len, void * data) \
156 return function (buff, len, &i); \
157 return function (buff, len, &conf->option); \
160 #define declare_def_snprint_defstr(option, function, value) \
162 snprint_def_ ## option (struct config *conf, char * buff, int len, void * data) \
166 return function (buff, len, &s); \
167 return function (buff, len, &conf->option); \
170 #define declare_hw_handler(option, function) \
172 hw_ ## option ## _handler (struct config *conf, vector strvec) \
174 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable); \
177 return function (strvec, &hwe->option); \
180 #define declare_hw_snprint(option, function) \
182 snprint_hw_ ## option (struct config *conf, char * buff, int len, void * data) \
184 struct hwentry * hwe = (struct hwentry *)data; \
185 return function (buff, len, &hwe->option); \
188 #define declare_ovr_handler(option, function) \
190 ovr_ ## option ## _handler (struct config *conf, vector strvec) \
192 if (!conf->overrides) \
194 return function (strvec, &conf->overrides->option); \
197 #define declare_ovr_snprint(option, function) \
199 snprint_ovr_ ## option (struct config *conf, char * buff, int len, void * data) \
201 return function (buff, len, &conf->overrides->option); \
204 #define declare_mp_handler(option, function) \
206 mp_ ## option ## _handler (struct config *conf, vector strvec) \
208 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable); \
211 return function (strvec, &mpe->option); \
214 #define declare_mp_snprint(option, function) \
216 snprint_mp_ ## option (struct config *conf, char * buff, int len, void * data) \
218 struct mpentry * mpe = (struct mpentry *)data; \
219 return function (buff, len, &mpe->option); \
222 declare_def_handler(checkint, set_int)
223 declare_def_snprint(checkint, print_int)
225 declare_def_handler(max_checkint, set_int)
226 declare_def_snprint(max_checkint, print_int)
228 declare_def_handler(verbosity, set_int)
229 declare_def_snprint(verbosity, print_int)
231 declare_def_handler(reassign_maps, set_yes_no)
232 declare_def_snprint(reassign_maps, print_yes_no)
234 declare_def_handler(multipath_dir, set_str)
235 declare_def_snprint(multipath_dir, print_str)
237 declare_def_handler(partition_delim, set_str)
238 declare_def_snprint(partition_delim, print_str)
240 declare_def_handler(find_multipaths, set_yes_no)
241 declare_def_snprint(find_multipaths, print_yes_no)
243 declare_def_handler(selector, set_str)
244 declare_def_snprint_defstr(selector, print_str, DEFAULT_SELECTOR)
245 declare_hw_handler(selector, set_str)
246 declare_hw_snprint(selector, print_str)
247 declare_ovr_handler(selector, set_str)
248 declare_ovr_snprint(selector, print_str)
249 declare_mp_handler(selector, set_str)
250 declare_mp_snprint(selector, print_str)
252 declare_def_handler(uid_attrs, set_str)
253 declare_def_snprint(uid_attrs, print_str)
254 declare_def_handler(uid_attribute, set_str)
255 declare_def_snprint_defstr(uid_attribute, print_str, DEFAULT_UID_ATTRIBUTE)
256 declare_ovr_handler(uid_attribute, set_str)
257 declare_ovr_snprint(uid_attribute, print_str)
258 declare_hw_handler(uid_attribute, set_str)
259 declare_hw_snprint(uid_attribute, print_str)
261 declare_def_handler(getuid, set_str)
262 declare_def_snprint(getuid, print_str)
263 declare_ovr_handler(getuid, set_str)
264 declare_ovr_snprint(getuid, print_str)
265 declare_hw_handler(getuid, set_str)
266 declare_hw_snprint(getuid, print_str)
268 declare_def_handler(prio_name, set_str)
269 declare_def_snprint_defstr(prio_name, print_str, DEFAULT_PRIO)
270 declare_ovr_handler(prio_name, set_str)
271 declare_ovr_snprint(prio_name, print_str)
272 declare_hw_handler(prio_name, set_str)
273 declare_hw_snprint(prio_name, print_str)
274 declare_mp_handler(prio_name, set_str)
275 declare_mp_snprint(prio_name, print_str)
277 declare_def_handler(alias_prefix, set_str)
278 declare_def_snprint_defstr(alias_prefix, print_str, DEFAULT_ALIAS_PREFIX)
279 declare_ovr_handler(alias_prefix, set_str)
280 declare_ovr_snprint(alias_prefix, print_str)
281 declare_hw_handler(alias_prefix, set_str)
282 declare_hw_snprint(alias_prefix, print_str)
284 declare_def_handler(prio_args, set_str)
285 declare_def_snprint_defstr(prio_args, print_str, DEFAULT_PRIO_ARGS)
286 declare_ovr_handler(prio_args, set_str)
287 declare_ovr_snprint(prio_args, print_str)
288 declare_hw_handler(prio_args, set_str)
289 declare_hw_snprint(prio_args, print_str)
290 declare_mp_handler(prio_args, set_str)
291 declare_mp_snprint(prio_args, print_str)
293 declare_def_handler(features, set_str)
294 declare_def_snprint_defstr(features, print_str, DEFAULT_FEATURES)
295 declare_ovr_handler(features, set_str)
296 declare_ovr_snprint(features, print_str)
297 declare_hw_handler(features, set_str)
298 declare_hw_snprint(features, print_str)
299 declare_mp_handler(features, set_str)
300 declare_mp_snprint(features, print_str)
302 declare_def_handler(checker_name, set_str)
303 declare_def_snprint_defstr(checker_name, print_str, DEFAULT_CHECKER)
304 declare_ovr_handler(checker_name, set_str)
305 declare_ovr_snprint(checker_name, print_str)
306 declare_hw_handler(checker_name, set_str)
307 declare_hw_snprint(checker_name, print_str)
309 declare_def_handler(minio, set_int)
310 declare_def_snprint_defint(minio, print_int, DEFAULT_MINIO)
311 declare_ovr_handler(minio, set_int)
312 declare_ovr_snprint(minio, print_nonzero)
313 declare_hw_handler(minio, set_int)
314 declare_hw_snprint(minio, print_nonzero)
315 declare_mp_handler(minio, set_int)
316 declare_mp_snprint(minio, print_nonzero)
318 declare_def_handler(minio_rq, set_int)
319 declare_def_snprint_defint(minio_rq, print_int, DEFAULT_MINIO_RQ)
320 declare_ovr_handler(minio_rq, set_int)
321 declare_ovr_snprint(minio_rq, print_nonzero)
322 declare_hw_handler(minio_rq, set_int)
323 declare_hw_snprint(minio_rq, print_nonzero)
324 declare_mp_handler(minio_rq, set_int)
325 declare_mp_snprint(minio_rq, print_nonzero)
327 declare_def_handler(queue_without_daemon, set_yes_no)
329 snprint_def_queue_without_daemon (struct config *conf,
330 char * buff, int len, void * data)
332 switch (conf->queue_without_daemon) {
333 case QUE_NO_DAEMON_OFF:
334 return snprintf(buff, len, "\"no\"");
335 case QUE_NO_DAEMON_ON:
336 return snprintf(buff, len, "\"yes\"");
337 case QUE_NO_DAEMON_FORCE:
338 return snprintf(buff, len, "\"forced\"");
343 declare_def_handler(checker_timeout, set_int)
344 declare_def_snprint(checker_timeout, print_nonzero)
346 declare_def_handler(flush_on_last_del, set_yes_no_undef)
347 declare_def_snprint_defint(flush_on_last_del, print_yes_no_undef, YNU_NO)
348 declare_ovr_handler(flush_on_last_del, set_yes_no_undef)
349 declare_ovr_snprint(flush_on_last_del, print_yes_no_undef)
350 declare_hw_handler(flush_on_last_del, set_yes_no_undef)
351 declare_hw_snprint(flush_on_last_del, print_yes_no_undef)
352 declare_mp_handler(flush_on_last_del, set_yes_no_undef)
353 declare_mp_snprint(flush_on_last_del, print_yes_no_undef)
355 declare_def_handler(user_friendly_names, set_yes_no_undef)
356 declare_def_snprint_defint(user_friendly_names, print_yes_no_undef, YNU_NO)
357 declare_ovr_handler(user_friendly_names, set_yes_no_undef)
358 declare_ovr_snprint(user_friendly_names, print_yes_no_undef)
359 declare_hw_handler(user_friendly_names, set_yes_no_undef)
360 declare_hw_snprint(user_friendly_names, print_yes_no_undef)
361 declare_mp_handler(user_friendly_names, set_yes_no_undef)
362 declare_mp_snprint(user_friendly_names, print_yes_no_undef)
364 declare_def_handler(bindings_file, set_str)
365 declare_def_snprint(bindings_file, print_str)
367 declare_def_handler(wwids_file, set_str)
368 declare_def_snprint(wwids_file, print_str)
370 declare_def_handler(retain_hwhandler, set_yes_no_undef)
371 declare_def_snprint_defint(retain_hwhandler, print_yes_no_undef, YNU_NO)
372 declare_ovr_handler(retain_hwhandler, set_yes_no_undef)
373 declare_ovr_snprint(retain_hwhandler, print_yes_no_undef)
374 declare_hw_handler(retain_hwhandler, set_yes_no_undef)
375 declare_hw_snprint(retain_hwhandler, print_yes_no_undef)
377 declare_def_handler(detect_prio, set_yes_no_undef)
378 declare_def_snprint_defint(detect_prio, print_yes_no_undef, YNU_NO)
379 declare_ovr_handler(detect_prio, set_yes_no_undef)
380 declare_ovr_snprint(detect_prio, print_yes_no_undef)
381 declare_hw_handler(detect_prio, set_yes_no_undef)
382 declare_hw_snprint(detect_prio, print_yes_no_undef)
384 declare_def_handler(detect_checker, set_yes_no_undef)
385 declare_def_snprint_defint(detect_checker, print_yes_no_undef, YNU_NO)
386 declare_ovr_handler(detect_checker, set_yes_no_undef)
387 declare_ovr_snprint(detect_checker, print_yes_no_undef)
388 declare_hw_handler(detect_checker, set_yes_no_undef)
389 declare_hw_snprint(detect_checker, print_yes_no_undef)
391 declare_def_handler(force_sync, set_yes_no)
392 declare_def_snprint(force_sync, print_yes_no)
394 declare_def_handler(deferred_remove, set_yes_no_undef)
395 declare_def_snprint_defint(deferred_remove, print_yes_no_undef, YNU_NO)
396 declare_ovr_handler(deferred_remove, set_yes_no_undef)
397 declare_ovr_snprint(deferred_remove, print_yes_no_undef)
398 declare_hw_handler(deferred_remove, set_yes_no_undef)
399 declare_hw_snprint(deferred_remove, print_yes_no_undef)
400 declare_mp_handler(deferred_remove, set_yes_no_undef)
401 declare_mp_snprint(deferred_remove, print_yes_no_undef)
403 declare_def_handler(retrigger_tries, set_int)
404 declare_def_snprint(retrigger_tries, print_int)
406 declare_def_handler(retrigger_delay, set_int)
407 declare_def_snprint(retrigger_delay, print_int)
409 declare_def_handler(uev_wait_timeout, set_int)
410 declare_def_snprint(uev_wait_timeout, print_int)
412 declare_def_handler(strict_timing, set_yes_no)
413 declare_def_snprint(strict_timing, print_yes_no)
415 declare_def_handler(skip_kpartx, set_yes_no_undef)
416 declare_def_snprint_defint(skip_kpartx, print_yes_no_undef, YNU_NO)
417 declare_ovr_handler(skip_kpartx, set_yes_no_undef)
418 declare_ovr_snprint(skip_kpartx, print_yes_no_undef)
419 declare_hw_handler(skip_kpartx, set_yes_no_undef)
420 declare_hw_snprint(skip_kpartx, print_yes_no_undef)
421 declare_mp_handler(skip_kpartx, set_yes_no_undef)
422 declare_mp_snprint(skip_kpartx, print_yes_no_undef)
424 declare_def_handler(disable_changed_wwids, set_yes_no)
425 declare_def_snprint(disable_changed_wwids, print_yes_no)
427 declare_def_handler(remove_retries, set_int)
428 declare_def_snprint(remove_retries, print_int)
430 declare_def_handler(max_sectors_kb, set_int)
431 declare_def_snprint(max_sectors_kb, print_nonzero)
432 declare_ovr_handler(max_sectors_kb, set_int)
433 declare_ovr_snprint(max_sectors_kb, print_nonzero)
434 declare_hw_handler(max_sectors_kb, set_int)
435 declare_hw_snprint(max_sectors_kb, print_nonzero)
436 declare_mp_handler(max_sectors_kb, set_int)
437 declare_mp_snprint(max_sectors_kb, print_nonzero)
440 def_config_dir_handler(struct config *conf, vector strvec)
442 /* this is only valid in the main config file */
443 if (conf->processed_main_config)
445 return set_str(strvec, &conf->config_dir);
447 declare_def_snprint(config_dir, print_str)
449 #define declare_def_attr_handler(option, function) \
451 def_ ## option ## _handler (struct config *conf, vector strvec) \
453 return function (strvec, &conf->option, &conf->attribute_flags);\
456 #define declare_def_attr_snprint(option, function) \
458 snprint_def_ ## option (struct config *conf, char * buff, int len, void * data) \
460 return function (buff, len, &conf->option, \
461 &conf->attribute_flags); \
464 #define declare_mp_attr_handler(option, function) \
466 mp_ ## option ## _handler (struct config *conf, vector strvec) \
468 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable); \
471 return function (strvec, &mpe->option, &mpe->attribute_flags); \
474 #define declare_mp_attr_snprint(option, function) \
476 snprint_mp_ ## option (struct config *conf, char * buff, int len, void * data) \
478 struct mpentry * mpe = (struct mpentry *)data; \
479 return function (buff, len, &mpe->option, \
480 &mpe->attribute_flags); \
484 set_mode(vector strvec, void *ptr, int *flags)
487 mode_t *mode_ptr = (mode_t *)ptr;
490 buff = set_value(strvec);
495 if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777) {
496 *flags |= (1 << ATTR_MODE);
505 set_uid(vector strvec, void *ptr, int *flags)
508 uid_t *uid_ptr = (uid_t *)ptr;
510 char passwd_buf[1024];
511 struct passwd info, *found;
513 buff = set_value(strvec);
516 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
517 *flags |= (1 << ATTR_UID);
518 *uid_ptr = info.pw_uid;
520 else if (sscanf(buff, "%u", &uid) == 1){
521 *flags |= (1 << ATTR_UID);
530 set_gid(vector strvec, void *ptr, int *flags)
533 gid_t *gid_ptr = (gid_t *)ptr;
535 char passwd_buf[1024];
536 struct passwd info, *found;
538 buff = set_value(strvec);
542 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
543 *flags |= (1 << ATTR_GID);
544 *gid_ptr = info.pw_gid;
546 else if (sscanf(buff, "%u", &gid) == 1){
547 *flags |= (1 << ATTR_GID);
555 print_mode(char * buff, int len, void *ptr, int *flags)
557 mode_t *mode_ptr = (mode_t *)ptr;
558 if ((*flags & (1 << ATTR_MODE)) == 0)
560 return snprintf(buff, len, "0%o", *mode_ptr);
564 print_uid(char * buff, int len, void *ptr, int *flags)
566 uid_t *uid_ptr = (uid_t *)ptr;
567 if ((*flags & (1 << ATTR_UID)) == 0)
569 return snprintf(buff, len, "0%o", *uid_ptr);
573 print_gid(char * buff, int len, void *ptr, int *flags)
575 gid_t *gid_ptr = (gid_t *)ptr;
576 if ((*flags & (1 << ATTR_GID)) == 0)
578 return snprintf(buff, len, "0%o", *gid_ptr);
581 declare_def_attr_handler(mode, set_mode)
582 declare_def_attr_snprint(mode, print_mode)
583 declare_mp_attr_handler(mode, set_mode)
584 declare_mp_attr_snprint(mode, print_mode)
586 declare_def_attr_handler(uid, set_uid)
587 declare_def_attr_snprint(uid, print_uid)
588 declare_mp_attr_handler(uid, set_uid)
589 declare_mp_attr_snprint(uid, print_uid)
591 declare_def_attr_handler(gid, set_gid)
592 declare_def_attr_snprint(gid, print_gid)
593 declare_mp_attr_handler(gid, set_gid)
594 declare_mp_attr_snprint(gid, print_gid)
597 set_fast_io_fail(vector strvec, void *ptr)
600 int *int_ptr = (int *)ptr;
602 buff = set_value(strvec);
606 if (strcmp(buff, "off") == 0)
607 *int_ptr = MP_FAST_IO_FAIL_OFF;
608 else if (sscanf(buff, "%d", int_ptr) != 1 ||
609 *int_ptr < MP_FAST_IO_FAIL_ZERO)
610 *int_ptr = MP_FAST_IO_FAIL_UNSET;
611 else if (*int_ptr == 0)
612 *int_ptr = MP_FAST_IO_FAIL_ZERO;
619 print_fast_io_fail(char * buff, int len, void *ptr)
621 int *int_ptr = (int *)ptr;
623 if (*int_ptr == MP_FAST_IO_FAIL_UNSET)
625 if (*int_ptr == MP_FAST_IO_FAIL_OFF)
626 return snprintf(buff, len, "\"off\"");
627 if (*int_ptr == MP_FAST_IO_FAIL_ZERO)
628 return snprintf(buff, len, "0");
629 return snprintf(buff, len, "%d", *int_ptr);
632 declare_def_handler(fast_io_fail, set_fast_io_fail)
633 declare_def_snprint(fast_io_fail, print_fast_io_fail)
634 declare_ovr_handler(fast_io_fail, set_fast_io_fail)
635 declare_ovr_snprint(fast_io_fail, print_fast_io_fail)
636 declare_hw_handler(fast_io_fail, set_fast_io_fail)
637 declare_hw_snprint(fast_io_fail, print_fast_io_fail)
640 set_dev_loss(vector strvec, void *ptr)
643 unsigned int *uint_ptr = (unsigned int *)ptr;
645 buff = set_value(strvec);
649 if (!strcmp(buff, "infinity"))
650 *uint_ptr = MAX_DEV_LOSS_TMO;
651 else if (sscanf(buff, "%u", uint_ptr) != 1)
659 print_dev_loss(char * buff, int len, void *ptr)
661 unsigned int *uint_ptr = (unsigned int *)ptr;
665 if (*uint_ptr >= MAX_DEV_LOSS_TMO)
666 return snprintf(buff, len, "\"infinity\"");
667 return snprintf(buff, len, "%u", *uint_ptr);
670 declare_def_handler(dev_loss, set_dev_loss)
671 declare_def_snprint(dev_loss, print_dev_loss)
672 declare_ovr_handler(dev_loss, set_dev_loss)
673 declare_ovr_snprint(dev_loss, print_dev_loss)
674 declare_hw_handler(dev_loss, set_dev_loss)
675 declare_hw_snprint(dev_loss, print_dev_loss)
678 set_pgpolicy(vector strvec, void *ptr)
681 int *int_ptr = (int *)ptr;
683 buff = set_value(strvec);
687 *int_ptr = get_pgpolicy_id(buff);
694 print_pgpolicy(char * buff, int len, void *ptr)
696 char str[POLICY_NAME_SIZE];
697 int pgpolicy = *(int *)ptr;
702 get_pgpolicy_name(str, POLICY_NAME_SIZE, pgpolicy);
704 return snprintf(buff, len, "\"%s\"", str);
707 declare_def_handler(pgpolicy, set_pgpolicy)
708 declare_def_snprint_defint(pgpolicy, print_pgpolicy, DEFAULT_PGPOLICY)
709 declare_ovr_handler(pgpolicy, set_pgpolicy)
710 declare_ovr_snprint(pgpolicy, print_pgpolicy)
711 declare_hw_handler(pgpolicy, set_pgpolicy)
712 declare_hw_snprint(pgpolicy, print_pgpolicy)
713 declare_mp_handler(pgpolicy, set_pgpolicy)
714 declare_mp_snprint(pgpolicy, print_pgpolicy)
717 get_sys_max_fds(int *max_fds)
723 file = fopen("/proc/sys/fs/nr_open", "r");
725 fprintf(stderr, "Cannot open /proc/sys/fs/nr_open : %s\n",
729 if (fscanf(file, "%d", &nr_open) != 1) {
730 fprintf(stderr, "Cannot read max open fds from /proc/sys/fs/nr_open");
732 fprintf(stderr, " : %s\n", strerror(errno));
734 fprintf(stderr, "\n");
745 max_fds_handler(struct config *conf, vector strvec)
750 buff = set_value(strvec);
755 r = get_sys_max_fds(&max_fds);
757 /* Assume safe limit */
760 if (strlen(buff) == 3 &&
761 !strcmp(buff, "max"))
762 conf->max_fds = max_fds;
764 conf->max_fds = atoi(buff);
766 if (conf->max_fds > max_fds)
767 conf->max_fds = max_fds;
775 snprint_max_fds (struct config *conf, char * buff, int len, void * data)
782 r = get_sys_max_fds(&max_fds);
783 if (!r && conf->max_fds >= max_fds)
784 return snprintf(buff, len, "\"max\"");
786 return snprintf(buff, len, "%d", conf->max_fds);
790 set_rr_weight(vector strvec, void *ptr)
792 int *int_ptr = (int *)ptr;
795 buff = set_value(strvec);
800 if (!strcmp(buff, "priorities"))
801 *int_ptr = RR_WEIGHT_PRIO;
803 if (!strcmp(buff, "uniform"))
804 *int_ptr = RR_WEIGHT_NONE;
812 print_rr_weight (char * buff, int len, void *ptr)
814 int *int_ptr = (int *)ptr;
818 if (*int_ptr == RR_WEIGHT_PRIO)
819 return snprintf(buff, len, "\"priorities\"");
820 if (*int_ptr == RR_WEIGHT_NONE)
821 return snprintf(buff, len, "\"uniform\"");
826 declare_def_handler(rr_weight, set_rr_weight)
827 declare_def_snprint_defint(rr_weight, print_rr_weight, RR_WEIGHT_NONE)
828 declare_ovr_handler(rr_weight, set_rr_weight)
829 declare_ovr_snprint(rr_weight, print_rr_weight)
830 declare_hw_handler(rr_weight, set_rr_weight)
831 declare_hw_snprint(rr_weight, print_rr_weight)
832 declare_mp_handler(rr_weight, set_rr_weight)
833 declare_mp_snprint(rr_weight, print_rr_weight)
836 set_pgfailback(vector strvec, void *ptr)
838 int *int_ptr = (int *)ptr;
841 buff = set_value(strvec);
845 if (strlen(buff) == 6 && !strcmp(buff, "manual"))
846 *int_ptr = -FAILBACK_MANUAL;
847 else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
848 *int_ptr = -FAILBACK_IMMEDIATE;
849 else if (strlen(buff) == 10 && !strcmp(buff, "followover"))
850 *int_ptr = -FAILBACK_FOLLOWOVER;
852 *int_ptr = atoi(buff);
860 print_pgfailback (char * buff, int len, void *ptr)
862 int *int_ptr = (int *)ptr;
867 case -FAILBACK_MANUAL:
868 return snprintf(buff, len, "\"manual\"");
869 case -FAILBACK_IMMEDIATE:
870 return snprintf(buff, len, "\"immediate\"");
871 case -FAILBACK_FOLLOWOVER:
872 return snprintf(buff, len, "\"followover\"");
874 return snprintf(buff, len, "%i", *int_ptr);
878 declare_def_handler(pgfailback, set_pgfailback)
879 declare_def_snprint_defint(pgfailback, print_pgfailback, DEFAULT_FAILBACK)
880 declare_ovr_handler(pgfailback, set_pgfailback)
881 declare_ovr_snprint(pgfailback, print_pgfailback)
882 declare_hw_handler(pgfailback, set_pgfailback)
883 declare_hw_snprint(pgfailback, print_pgfailback)
884 declare_mp_handler(pgfailback, set_pgfailback)
885 declare_mp_snprint(pgfailback, print_pgfailback)
888 set_no_path_retry(vector strvec, void *ptr)
890 int *int_ptr = (int *)ptr;
893 buff = set_value(strvec);
897 if (!strcmp(buff, "fail") || !strcmp(buff, "0"))
898 *int_ptr = NO_PATH_RETRY_FAIL;
899 else if (!strcmp(buff, "queue"))
900 *int_ptr = NO_PATH_RETRY_QUEUE;
901 else if ((*int_ptr = atoi(buff)) < 1)
902 *int_ptr = NO_PATH_RETRY_UNDEF;
909 print_no_path_retry(char * buff, int len, void *ptr)
911 int *int_ptr = (int *)ptr;
914 case NO_PATH_RETRY_UNDEF:
916 case NO_PATH_RETRY_FAIL:
917 return snprintf(buff, len, "\"fail\"");
918 case NO_PATH_RETRY_QUEUE:
919 return snprintf(buff, len, "\"queue\"");
921 return snprintf(buff, len, "%i", *int_ptr);
925 declare_def_handler(no_path_retry, set_no_path_retry)
926 declare_def_snprint(no_path_retry, print_no_path_retry)
927 declare_ovr_handler(no_path_retry, set_no_path_retry)
928 declare_ovr_snprint(no_path_retry, print_no_path_retry)
929 declare_hw_handler(no_path_retry, set_no_path_retry)
930 declare_hw_snprint(no_path_retry, print_no_path_retry)
931 declare_mp_handler(no_path_retry, set_no_path_retry)
932 declare_mp_snprint(no_path_retry, print_no_path_retry)
935 def_log_checker_err_handler(struct config *conf, vector strvec)
939 buff = set_value(strvec);
944 if (strlen(buff) == 4 && !strcmp(buff, "once"))
945 conf->log_checker_err = LOG_CHKR_ERR_ONCE;
946 else if (strlen(buff) == 6 && !strcmp(buff, "always"))
947 conf->log_checker_err = LOG_CHKR_ERR_ALWAYS;
954 snprint_def_log_checker_err (struct config *conf, char * buff, int len, void * data)
956 if (conf->log_checker_err == LOG_CHKR_ERR_ONCE)
957 return snprintf(buff, len, "once");
958 return snprintf(buff, len, "always");
962 set_reservation_key(vector strvec, void *ptr)
964 unsigned char **uchar_ptr = (unsigned char **)ptr;
971 buff = set_value(strvec);
977 if (!memcmp("0x",buff, 2))
982 k = strspn(buff, "0123456789aAbBcCdDeEfF");
989 if (1 != sscanf (buff, "%" SCNx64 "", &prkey))
996 *uchar_ptr = (unsigned char *) malloc(8);
998 memset(*uchar_ptr, 0, 8);
1000 for (j = 7; j >= 0; --j) {
1001 (*uchar_ptr)[j] = (prkey & 0xff);
1010 print_reservation_key(char * buff, int len, void * ptr)
1012 unsigned char **uchar_ptr = (unsigned char **)ptr;
1014 unsigned char *keyp;
1019 keyp = (unsigned char *)(*uchar_ptr);
1020 for (i = 0; i < 8; i++) {
1026 return snprintf(buff, len, "0x%" PRIx64, prkey);
1029 declare_def_handler(reservation_key, set_reservation_key)
1030 declare_def_snprint(reservation_key, print_reservation_key)
1031 declare_mp_handler(reservation_key, set_reservation_key)
1032 declare_mp_snprint(reservation_key, print_reservation_key)
1035 set_off_int_undef(vector strvec, void *ptr)
1037 int *int_ptr = (int *)ptr;
1040 buff = set_value(strvec);
1044 if (!strcmp(buff, "no") || !strcmp(buff, "0"))
1046 else if ((*int_ptr = atoi(buff)) < 1)
1047 *int_ptr = NU_UNDEF;
1054 print_off_int_undef(char * buff, int len, void *ptr)
1056 int *int_ptr = (int *)ptr;
1062 return snprintf(buff, len, "\"no\"");
1064 return snprintf(buff, len, "%i", *int_ptr);
1068 declare_def_handler(delay_watch_checks, set_off_int_undef)
1069 declare_def_snprint(delay_watch_checks, print_off_int_undef)
1070 declare_ovr_handler(delay_watch_checks, set_off_int_undef)
1071 declare_ovr_snprint(delay_watch_checks, print_off_int_undef)
1072 declare_hw_handler(delay_watch_checks, set_off_int_undef)
1073 declare_hw_snprint(delay_watch_checks, print_off_int_undef)
1074 declare_mp_handler(delay_watch_checks, set_off_int_undef)
1075 declare_mp_snprint(delay_watch_checks, print_off_int_undef)
1076 declare_def_handler(delay_wait_checks, set_off_int_undef)
1077 declare_def_snprint(delay_wait_checks, print_off_int_undef)
1078 declare_ovr_handler(delay_wait_checks, set_off_int_undef)
1079 declare_ovr_snprint(delay_wait_checks, print_off_int_undef)
1080 declare_hw_handler(delay_wait_checks, set_off_int_undef)
1081 declare_hw_snprint(delay_wait_checks, print_off_int_undef)
1082 declare_mp_handler(delay_wait_checks, set_off_int_undef)
1083 declare_mp_snprint(delay_wait_checks, print_off_int_undef)
1084 declare_def_handler(san_path_err_threshold, set_off_int_undef)
1085 declare_def_snprint(san_path_err_threshold, print_off_int_undef)
1086 declare_ovr_handler(san_path_err_threshold, set_off_int_undef)
1087 declare_ovr_snprint(san_path_err_threshold, print_off_int_undef)
1088 declare_hw_handler(san_path_err_threshold, set_off_int_undef)
1089 declare_hw_snprint(san_path_err_threshold, print_off_int_undef)
1090 declare_mp_handler(san_path_err_threshold, set_off_int_undef)
1091 declare_mp_snprint(san_path_err_threshold, print_off_int_undef)
1092 declare_def_handler(san_path_err_forget_rate, set_off_int_undef)
1093 declare_def_snprint(san_path_err_forget_rate, print_off_int_undef)
1094 declare_ovr_handler(san_path_err_forget_rate, set_off_int_undef)
1095 declare_ovr_snprint(san_path_err_forget_rate, print_off_int_undef)
1096 declare_hw_handler(san_path_err_forget_rate, set_off_int_undef)
1097 declare_hw_snprint(san_path_err_forget_rate, print_off_int_undef)
1098 declare_mp_handler(san_path_err_forget_rate, set_off_int_undef)
1099 declare_mp_snprint(san_path_err_forget_rate, print_off_int_undef)
1100 declare_def_handler(san_path_err_recovery_time, set_off_int_undef)
1101 declare_def_snprint(san_path_err_recovery_time, print_off_int_undef)
1102 declare_ovr_handler(san_path_err_recovery_time, set_off_int_undef)
1103 declare_ovr_snprint(san_path_err_recovery_time, print_off_int_undef)
1104 declare_hw_handler(san_path_err_recovery_time, set_off_int_undef)
1105 declare_hw_snprint(san_path_err_recovery_time, print_off_int_undef)
1106 declare_mp_handler(san_path_err_recovery_time, set_off_int_undef)
1107 declare_mp_snprint(san_path_err_recovery_time, print_off_int_undef)
1109 def_uxsock_timeout_handler(struct config *conf, vector strvec)
1111 unsigned int uxsock_timeout;
1114 buff = set_value(strvec);
1118 if (sscanf(buff, "%u", &uxsock_timeout) == 1 &&
1119 uxsock_timeout > DEFAULT_REPLY_TIMEOUT)
1120 conf->uxsock_timeout = uxsock_timeout;
1122 conf->uxsock_timeout = DEFAULT_REPLY_TIMEOUT;
1129 * blacklist block handlers
1132 blacklist_handler(struct config *conf, vector strvec)
1134 if (!conf->blist_devnode)
1135 conf->blist_devnode = vector_alloc();
1136 if (!conf->blist_wwid)
1137 conf->blist_wwid = vector_alloc();
1138 if (!conf->blist_device)
1139 conf->blist_device = vector_alloc();
1140 if (!conf->blist_property)
1141 conf->blist_property = vector_alloc();
1143 if (!conf->blist_devnode || !conf->blist_wwid ||
1144 !conf->blist_device || !conf->blist_property)
1151 blacklist_exceptions_handler(struct config *conf, vector strvec)
1153 if (!conf->elist_devnode)
1154 conf->elist_devnode = vector_alloc();
1155 if (!conf->elist_wwid)
1156 conf->elist_wwid = vector_alloc();
1157 if (!conf->elist_device)
1158 conf->elist_device = vector_alloc();
1159 if (!conf->elist_property)
1160 conf->elist_property = vector_alloc();
1162 if (!conf->elist_devnode || !conf->elist_wwid ||
1163 !conf->elist_device || !conf->elist_property)
1169 #define declare_ble_handler(option) \
1171 ble_ ## option ## _handler (struct config *conf, vector strvec) \
1175 if (!conf->option) \
1178 buff = set_value(strvec); \
1182 return store_ble(conf->option, buff, ORIGIN_CONFIG); \
1185 #define declare_ble_device_handler(name, option, vend, prod) \
1187 ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \
1191 if (!conf->option) \
1194 buff = set_value(strvec); \
1198 return set_ble_device(conf->option, vend, prod, ORIGIN_CONFIG); \
1201 declare_ble_handler(blist_devnode)
1202 declare_ble_handler(elist_devnode)
1203 declare_ble_handler(blist_wwid)
1204 declare_ble_handler(elist_wwid)
1205 declare_ble_handler(blist_property)
1206 declare_ble_handler(elist_property)
1209 snprint_def_uxsock_timeout(struct config *conf, char * buff, int len, void * data)
1211 return snprintf(buff, len, "%u", conf->uxsock_timeout);
1215 snprint_ble_simple (struct config *conf, char * buff, int len, void * data)
1217 struct blentry * ble = (struct blentry *)data;
1219 return snprintf(buff, len, "\"%s\"", ble->str);
1223 ble_device_handler(struct config *conf, vector strvec)
1225 return alloc_ble_device(conf->blist_device);
1229 ble_except_device_handler(struct config *conf, vector strvec)
1231 return alloc_ble_device(conf->elist_device);
1234 declare_ble_device_handler(vendor, blist_device, buff, NULL)
1235 declare_ble_device_handler(vendor, elist_device, buff, NULL)
1236 declare_ble_device_handler(product, blist_device, NULL, buff)
1237 declare_ble_device_handler(product, elist_device, NULL, buff)
1240 snprint_bled_vendor (struct config *conf, char * buff, int len, void * data)
1242 struct blentry_device * bled = (struct blentry_device *)data;
1244 return snprintf(buff, len, "\"%s\"", bled->vendor);
1248 snprint_bled_product (struct config *conf, char * buff, int len, void * data)
1250 struct blentry_device * bled = (struct blentry_device *)data;
1252 return snprintf(buff, len, "\"%s\"", bled->product);
1256 * devices block handlers
1259 devices_handler(struct config *conf, vector strvec)
1262 conf->hwtable = vector_alloc();
1271 device_handler(struct config *conf, vector strvec)
1273 struct hwentry * hwe;
1280 if (!vector_alloc_slot(conf->hwtable)) {
1284 vector_set_slot(conf->hwtable, hwe);
1289 declare_hw_handler(vendor, set_str)
1290 declare_hw_snprint(vendor, print_str)
1292 declare_hw_handler(product, set_str)
1293 declare_hw_snprint(product, print_str)
1295 declare_hw_handler(revision, set_str)
1296 declare_hw_snprint(revision, print_str)
1298 declare_hw_handler(bl_product, set_str)
1299 declare_hw_snprint(bl_product, print_str)
1301 declare_hw_handler(hwhandler, set_str)
1302 declare_hw_snprint(hwhandler, print_str)
1305 * overrides handlers
1308 overrides_handler(struct config *conf, vector strvec)
1310 if (!conf->overrides)
1311 conf->overrides = alloc_hwe();
1313 if (!conf->overrides)
1322 * multipaths block handlers
1325 multipaths_handler(struct config *conf, vector strvec)
1328 conf->mptable = vector_alloc();
1337 multipath_handler(struct config *conf, vector strvec)
1339 struct mpentry * mpe;
1346 if (!vector_alloc_slot(conf->mptable)) {
1350 vector_set_slot(conf->mptable, mpe);
1355 declare_mp_handler(wwid, set_str)
1356 declare_mp_snprint(wwid, print_str)
1358 declare_mp_handler(alias, set_str)
1359 declare_mp_snprint(alias, print_str)
1362 * deprecated handlers
1366 deprecated_handler(struct config *conf, vector strvec)
1370 buff = set_value(strvec);
1380 snprint_deprecated (struct config *conf, char * buff, int len, void * data)
1385 #define __deprecated
1388 * If you add or remove a keyword also update multipath/multipath.conf.5
1391 init_keywords(vector keywords)
1393 install_keyword_root("defaults", NULL);
1394 install_keyword("verbosity", &def_verbosity_handler, &snprint_def_verbosity);
1395 install_keyword("polling_interval", &def_checkint_handler, &snprint_def_checkint);
1396 install_keyword("max_polling_interval", &def_max_checkint_handler, &snprint_def_max_checkint);
1397 install_keyword("reassign_maps", &def_reassign_maps_handler, &snprint_def_reassign_maps);
1398 install_keyword("multipath_dir", &def_multipath_dir_handler, &snprint_def_multipath_dir);
1399 install_keyword("path_selector", &def_selector_handler, &snprint_def_selector);
1400 install_keyword("path_grouping_policy", &def_pgpolicy_handler, &snprint_def_pgpolicy);
1401 install_keyword("uid_attrs", &def_uid_attrs_handler, &snprint_def_uid_attrs);
1402 install_keyword("uid_attribute", &def_uid_attribute_handler, &snprint_def_uid_attribute);
1403 install_keyword("getuid_callout", &def_getuid_handler, &snprint_def_getuid);
1404 install_keyword("prio", &def_prio_name_handler, &snprint_def_prio_name);
1405 install_keyword("prio_args", &def_prio_args_handler, &snprint_def_prio_args);
1406 install_keyword("features", &def_features_handler, &snprint_def_features);
1407 install_keyword("path_checker", &def_checker_name_handler, &snprint_def_checker_name);
1408 install_keyword("checker", &def_checker_name_handler, NULL);
1409 install_keyword("alias_prefix", &def_alias_prefix_handler, &snprint_def_alias_prefix);
1410 install_keyword("failback", &def_pgfailback_handler, &snprint_def_pgfailback);
1411 install_keyword("rr_min_io", &def_minio_handler, &snprint_def_minio);
1412 install_keyword("rr_min_io_rq", &def_minio_rq_handler, &snprint_def_minio_rq);
1413 install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
1414 install_keyword("rr_weight", &def_rr_weight_handler, &snprint_def_rr_weight);
1415 install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
1416 install_keyword("queue_without_daemon", &def_queue_without_daemon_handler, &snprint_def_queue_without_daemon);
1417 install_keyword("checker_timeout", &def_checker_timeout_handler, &snprint_def_checker_timeout);
1418 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
1419 install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
1420 install_keyword("user_friendly_names", &def_user_friendly_names_handler, &snprint_def_user_friendly_names);
1421 install_keyword("mode", &def_mode_handler, &snprint_def_mode);
1422 install_keyword("uid", &def_uid_handler, &snprint_def_uid);
1423 install_keyword("gid", &def_gid_handler, &snprint_def_gid);
1424 install_keyword("fast_io_fail_tmo", &def_fast_io_fail_handler, &snprint_def_fast_io_fail);
1425 install_keyword("dev_loss_tmo", &def_dev_loss_handler, &snprint_def_dev_loss);
1426 install_keyword("bindings_file", &def_bindings_file_handler, &snprint_def_bindings_file);
1427 install_keyword("wwids_file", &def_wwids_file_handler, &snprint_def_wwids_file);
1428 install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
1429 install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
1430 install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler);
1431 install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
1432 install_keyword("detect_checker", &def_detect_checker_handler, &snprint_def_detect_checker);
1433 install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync);
1434 install_keyword("strict_timing", &def_strict_timing_handler, &snprint_def_strict_timing);
1435 install_keyword("deferred_remove", &def_deferred_remove_handler, &snprint_def_deferred_remove);
1436 install_keyword("partition_delimiter", &def_partition_delim_handler, &snprint_def_partition_delim);
1437 install_keyword("config_dir", &def_config_dir_handler, &snprint_def_config_dir);
1438 install_keyword("delay_watch_checks", &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks);
1439 install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks);
1440 install_keyword("san_path_err_threshold", &def_san_path_err_threshold_handler, &snprint_def_san_path_err_threshold);
1441 install_keyword("san_path_err_forget_rate", &def_san_path_err_forget_rate_handler, &snprint_def_san_path_err_forget_rate);
1442 install_keyword("san_path_err_recovery_time", &def_san_path_err_recovery_time_handler, &snprint_def_san_path_err_recovery_time);
1444 install_keyword("find_multipaths", &def_find_multipaths_handler, &snprint_def_find_multipaths);
1445 install_keyword("uxsock_timeout", &def_uxsock_timeout_handler, &snprint_def_uxsock_timeout);
1446 install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries);
1447 install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay);
1448 install_keyword("missing_uev_wait_timeout", &def_uev_wait_timeout_handler, &snprint_def_uev_wait_timeout);
1449 install_keyword("skip_kpartx", &def_skip_kpartx_handler, &snprint_def_skip_kpartx);
1450 install_keyword("disable_changed_wwids", &def_disable_changed_wwids_handler, &snprint_def_disable_changed_wwids);
1451 install_keyword("remove_retries", &def_remove_retries_handler, &snprint_def_remove_retries);
1452 install_keyword("max_sectors_kb", &def_max_sectors_kb_handler, &snprint_def_max_sectors_kb);
1453 __deprecated install_keyword("default_selector", &def_selector_handler, NULL);
1454 __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
1455 __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
1456 __deprecated install_keyword("default_getuid_callout", &def_getuid_handler, NULL);
1457 __deprecated install_keyword("default_features", &def_features_handler, NULL);
1458 __deprecated install_keyword("default_path_checker", &def_checker_name_handler, NULL);
1460 install_keyword_root("blacklist", &blacklist_handler);
1461 install_keyword_multi("devnode", &ble_blist_devnode_handler, &snprint_ble_simple);
1462 install_keyword_multi("wwid", &ble_blist_wwid_handler, &snprint_ble_simple);
1463 install_keyword_multi("property", &ble_blist_property_handler, &snprint_ble_simple);
1464 install_keyword_multi("device", &ble_device_handler, NULL);
1466 install_keyword("vendor", &ble_blist_device_vendor_handler, &snprint_bled_vendor);
1467 install_keyword("product", &ble_blist_device_product_handler, &snprint_bled_product);
1468 install_sublevel_end();
1469 install_keyword_root("blacklist_exceptions", &blacklist_exceptions_handler);
1470 install_keyword_multi("devnode", &ble_elist_devnode_handler, &snprint_ble_simple);
1471 install_keyword_multi("wwid", &ble_elist_wwid_handler, &snprint_ble_simple);
1472 install_keyword_multi("property", &ble_elist_property_handler, &snprint_ble_simple);
1473 install_keyword_multi("device", &ble_except_device_handler, NULL);
1475 install_keyword("vendor", &ble_elist_device_vendor_handler, &snprint_bled_vendor);
1476 install_keyword("product", &ble_elist_device_product_handler, &snprint_bled_product);
1477 install_sublevel_end();
1480 __deprecated install_keyword_root("devnode_blacklist", &blacklist_handler);
1481 __deprecated install_keyword("devnode", &ble_devnode_handler, &snprint_ble_simple);
1482 __deprecated install_keyword("wwid", &ble_wwid_handler, &snprint_ble_simple);
1483 __deprecated install_keyword("device", &ble_device_handler, NULL);
1484 __deprecated install_sublevel();
1485 __deprecated install_keyword("vendor", &ble_vendor_handler, &snprint_bled_vendor);
1486 __deprecated install_keyword("product", &ble_product_handler, &snprint_bled_product);
1487 __deprecated install_sublevel_end();
1490 * If you add or remove a "device subsection" keyword also update
1491 * multipath/multipath.conf.5 and the TEMPLATE in libmultipath/hwtable.c
1493 install_keyword_root("devices", &devices_handler);
1494 install_keyword_multi("device", &device_handler, NULL);
1496 install_keyword("vendor", &hw_vendor_handler, &snprint_hw_vendor);
1497 install_keyword("product", &hw_product_handler, &snprint_hw_product);
1498 install_keyword("revision", &hw_revision_handler, &snprint_hw_revision);
1499 install_keyword("product_blacklist", &hw_bl_product_handler, &snprint_hw_bl_product);
1500 install_keyword("path_grouping_policy", &hw_pgpolicy_handler, &snprint_hw_pgpolicy);
1501 install_keyword("uid_attribute", &hw_uid_attribute_handler, &snprint_hw_uid_attribute);
1502 install_keyword("getuid_callout", &hw_getuid_handler, &snprint_hw_getuid);
1503 install_keyword("path_selector", &hw_selector_handler, &snprint_hw_selector);
1504 install_keyword("path_checker", &hw_checker_name_handler, &snprint_hw_checker_name);
1505 install_keyword("checker", &hw_checker_name_handler, NULL);
1506 install_keyword("alias_prefix", &hw_alias_prefix_handler, &snprint_hw_alias_prefix);
1507 install_keyword("features", &hw_features_handler, &snprint_hw_features);
1508 install_keyword("hardware_handler", &hw_hwhandler_handler, &snprint_hw_hwhandler);
1509 install_keyword("prio", &hw_prio_name_handler, &snprint_hw_prio_name);
1510 install_keyword("prio_args", &hw_prio_args_handler, &snprint_hw_prio_args);
1511 install_keyword("failback", &hw_pgfailback_handler, &snprint_hw_pgfailback);
1512 install_keyword("rr_weight", &hw_rr_weight_handler, &snprint_hw_rr_weight);
1513 install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
1514 install_keyword("rr_min_io", &hw_minio_handler, &snprint_hw_minio);
1515 install_keyword("rr_min_io_rq", &hw_minio_rq_handler, &snprint_hw_minio_rq);
1516 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
1517 install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler, &snprint_hw_flush_on_last_del);
1518 install_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
1519 install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
1520 install_keyword("user_friendly_names", &hw_user_friendly_names_handler, &snprint_hw_user_friendly_names);
1521 install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler);
1522 install_keyword("detect_prio", &hw_detect_prio_handler, &snprint_hw_detect_prio);
1523 install_keyword("detect_checker", &hw_detect_checker_handler, &snprint_hw_detect_checker);
1524 install_keyword("deferred_remove", &hw_deferred_remove_handler, &snprint_hw_deferred_remove);
1525 install_keyword("delay_watch_checks", &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks);
1526 install_keyword("delay_wait_checks", &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks);
1527 install_keyword("san_path_err_threshold", &hw_san_path_err_threshold_handler, &snprint_hw_san_path_err_threshold);
1528 install_keyword("san_path_err_forget_rate", &hw_san_path_err_forget_rate_handler, &snprint_hw_san_path_err_forget_rate);
1529 install_keyword("san_path_err_recovery_time", &hw_san_path_err_recovery_time_handler, &snprint_hw_san_path_err_recovery_time);
1530 install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx);
1531 install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb);
1532 install_sublevel_end();
1534 install_keyword_root("overrides", &overrides_handler);
1535 install_keyword("path_grouping_policy", &ovr_pgpolicy_handler, &snprint_ovr_pgpolicy);
1536 install_keyword("uid_attribute", &ovr_uid_attribute_handler, &snprint_ovr_uid_attribute);
1537 install_keyword("getuid_callout", &ovr_getuid_handler, &snprint_ovr_getuid);
1538 install_keyword("path_selector", &ovr_selector_handler, &snprint_ovr_selector);
1539 install_keyword("path_checker", &ovr_checker_name_handler, &snprint_ovr_checker_name);
1540 install_keyword("checker", &ovr_checker_name_handler, NULL);
1541 install_keyword("alias_prefix", &ovr_alias_prefix_handler, &snprint_ovr_alias_prefix);
1542 install_keyword("features", &ovr_features_handler, &snprint_ovr_features);
1543 install_keyword("prio", &ovr_prio_name_handler, &snprint_ovr_prio_name);
1544 install_keyword("prio_args", &ovr_prio_args_handler, &snprint_ovr_prio_args);
1545 install_keyword("failback", &ovr_pgfailback_handler, &snprint_ovr_pgfailback);
1546 install_keyword("rr_weight", &ovr_rr_weight_handler, &snprint_ovr_rr_weight);
1547 install_keyword("no_path_retry", &ovr_no_path_retry_handler, &snprint_ovr_no_path_retry);
1548 install_keyword("rr_min_io", &ovr_minio_handler, &snprint_ovr_minio);
1549 install_keyword("rr_min_io_rq", &ovr_minio_rq_handler, &snprint_ovr_minio_rq);
1550 install_keyword("flush_on_last_del", &ovr_flush_on_last_del_handler, &snprint_ovr_flush_on_last_del);
1551 install_keyword("fast_io_fail_tmo", &ovr_fast_io_fail_handler, &snprint_ovr_fast_io_fail);
1552 install_keyword("dev_loss_tmo", &ovr_dev_loss_handler, &snprint_ovr_dev_loss);
1553 install_keyword("user_friendly_names", &ovr_user_friendly_names_handler, &snprint_ovr_user_friendly_names);
1554 install_keyword("retain_attached_hw_handler", &ovr_retain_hwhandler_handler, &snprint_ovr_retain_hwhandler);
1555 install_keyword("detect_prio", &ovr_detect_prio_handler, &snprint_ovr_detect_prio);
1556 install_keyword("detect_checker", &ovr_detect_checker_handler, &snprint_ovr_detect_checker);
1557 install_keyword("deferred_remove", &ovr_deferred_remove_handler, &snprint_ovr_deferred_remove);
1558 install_keyword("delay_watch_checks", &ovr_delay_watch_checks_handler, &snprint_ovr_delay_watch_checks);
1559 install_keyword("delay_wait_checks", &ovr_delay_wait_checks_handler, &snprint_ovr_delay_wait_checks);
1560 install_keyword("san_path_err_threshold", &ovr_san_path_err_threshold_handler, &snprint_ovr_san_path_err_threshold);
1561 install_keyword("san_path_err_forget_rate", &ovr_san_path_err_forget_rate_handler, &snprint_ovr_san_path_err_forget_rate);
1562 install_keyword("san_path_err_recovery_time", &ovr_san_path_err_recovery_time_handler, &snprint_ovr_san_path_err_recovery_time);
1564 install_keyword("skip_kpartx", &ovr_skip_kpartx_handler, &snprint_ovr_skip_kpartx);
1565 install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb);
1567 install_keyword_root("multipaths", &multipaths_handler);
1568 install_keyword_multi("multipath", &multipath_handler, NULL);
1570 install_keyword("wwid", &mp_wwid_handler, &snprint_mp_wwid);
1571 install_keyword("alias", &mp_alias_handler, &snprint_mp_alias);
1572 install_keyword("path_grouping_policy", &mp_pgpolicy_handler, &snprint_mp_pgpolicy);
1573 install_keyword("path_selector", &mp_selector_handler, &snprint_mp_selector);
1574 install_keyword("prio", &mp_prio_name_handler, &snprint_mp_prio_name);
1575 install_keyword("prio_args", &mp_prio_args_handler, &snprint_mp_prio_args);
1576 install_keyword("failback", &mp_pgfailback_handler, &snprint_mp_pgfailback);
1577 install_keyword("rr_weight", &mp_rr_weight_handler, &snprint_mp_rr_weight);
1578 install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
1579 install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_minio);
1580 install_keyword("rr_min_io_rq", &mp_minio_rq_handler, &snprint_mp_minio_rq);
1581 install_keyword("pg_timeout", &deprecated_handler, &snprint_deprecated);
1582 install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
1583 install_keyword("features", &mp_features_handler, &snprint_mp_features);
1584 install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
1585 install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
1586 install_keyword("gid", &mp_gid_handler, &snprint_mp_gid);
1587 install_keyword("reservation_key", &mp_reservation_key_handler, &snprint_mp_reservation_key);
1588 install_keyword("user_friendly_names", &mp_user_friendly_names_handler, &snprint_mp_user_friendly_names);
1589 install_keyword("deferred_remove", &mp_deferred_remove_handler, &snprint_mp_deferred_remove);
1590 install_keyword("delay_watch_checks", &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks);
1591 install_keyword("delay_wait_checks", &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks);
1592 install_keyword("san_path_err_threshold", &mp_san_path_err_threshold_handler, &snprint_mp_san_path_err_threshold);
1593 install_keyword("san_path_err_forget_rate", &mp_san_path_err_forget_rate_handler, &snprint_mp_san_path_err_forget_rate);
1594 install_keyword("san_path_err_recovery_time", &mp_san_path_err_recovery_time_handler, &snprint_mp_san_path_err_recovery_time);
1595 install_keyword("skip_kpartx", &mp_skip_kpartx_handler, &snprint_mp_skip_kpartx);
1596 install_keyword("max_sectors_kb", &mp_max_sectors_kb_handler, &snprint_mp_max_sectors_kb);
1597 install_sublevel_end();