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"
26 * default block handlers
29 polling_interval_handler(vector strvec)
33 buff = VECTOR_SLOT(strvec, 1);
34 conf->checkint = atoi(buff);
35 conf->max_checkint = MAX_CHECKINT(conf->checkint);
41 def_fast_io_fail_handler(vector strvec)
45 buff = set_value(strvec);
46 if (strlen(buff) == 3 && !strcmp(buff, "off"))
47 conf->fast_io_fail = MP_FAST_IO_FAIL_OFF;
48 else if (sscanf(buff, "%d", &conf->fast_io_fail) != 1 ||
49 conf->fast_io_fail < MP_FAST_IO_FAIL_ZERO)
50 conf->fast_io_fail = 0;
51 else if (conf->fast_io_fail == 0)
52 conf->fast_io_fail = MP_FAST_IO_FAIL_ZERO;
59 def_dev_loss_handler(vector strvec)
63 buff = set_value(strvec);
67 if (strlen(buff) == 8 && !strcmp(buff, "infinity"))
68 conf->dev_loss = MAX_DEV_LOSS_TMO;
69 else if (sscanf(buff, "%u", &conf->dev_loss) != 1)
77 verbosity_handler(vector strvec)
81 buff = VECTOR_SLOT(strvec, 1);
82 conf->verbosity = atoi(buff);
88 max_polling_interval_handler(vector strvec)
92 buff = VECTOR_SLOT(strvec, 1);
93 conf->max_checkint = atoi(buff);
99 reassign_maps_handler(vector strvec)
103 buff = set_value(strvec);
104 if (!strcmp(buff, "yes"))
105 conf->reassign_maps = 1;
106 else if (!strcmp(buff, "no"))
107 conf->reassign_maps = 0;
115 udev_dir_handler(vector strvec)
117 conf->udev_dir = set_value(strvec);
126 multipath_dir_handler(vector strvec)
128 conf->multipath_dir = set_value(strvec);
130 if (!conf->multipath_dir)
137 def_selector_handler(vector strvec)
139 conf->selector = set_value(strvec);
148 def_pgpolicy_handler(vector strvec)
152 buff = set_value(strvec);
157 conf->pgpolicy = get_pgpolicy_id(buff);
164 def_uid_attribute_handler(vector strvec)
166 conf->uid_attribute = set_value(strvec);
168 if (!conf->uid_attribute)
175 def_prio_handler(vector strvec)
177 conf->prio_name = set_value(strvec);
179 if (!conf->prio_name)
186 def_alias_prefix_handler(vector strvec)
188 conf->alias_prefix = set_value(strvec);
190 if (!conf->alias_prefix)
197 def_prio_args_handler(vector strvec)
199 conf->prio_args = set_value(strvec);
201 if (!conf->prio_args)
208 def_features_handler(vector strvec)
210 conf->features = set_value(strvec);
219 def_path_checker_handler(vector strvec)
221 conf->checker_name = set_value(strvec);
223 if (!conf->checker_name)
230 def_minio_handler(vector strvec)
234 buff = set_value(strvec);
239 conf->minio = atoi(buff);
246 def_minio_rq_handler(vector strvec)
250 buff = set_value(strvec);
255 conf->minio_rq = atoi(buff);
262 get_sys_max_fds(int *max_fds)
268 file = fopen("/proc/sys/fs/nr_open", "r");
270 fprintf(stderr, "Cannot open /proc/sys/fs/nr_open : %s\n",
274 if (fscanf(file, "%d", &nr_open) != 1) {
275 fprintf(stderr, "Cannot read max open fds from /proc/sys/fs/nr_open");
277 fprintf(stderr, " : %s\n", strerror(errno));
279 fprintf(stderr, "\n");
290 max_fds_handler(vector strvec)
295 buff = set_value(strvec);
300 if (strlen(buff) == 3 &&
301 !strcmp(buff, "max"))
302 r = get_sys_max_fds(&conf->max_fds);
304 conf->max_fds = atoi(buff);
311 def_mode_handler(vector strvec)
316 buff = set_value(strvec);
321 if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777) {
322 conf->attribute_flags |= (1 << ATTR_MODE);
331 def_uid_handler(vector strvec)
335 char passwd_buf[1024];
336 struct passwd info, *found;
338 buff = set_value(strvec);
341 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
342 conf->attribute_flags |= (1 << ATTR_UID);
343 conf->uid = info.pw_uid;
345 else if (sscanf(buff, "%u", &uid) == 1){
346 conf->attribute_flags |= (1 << ATTR_UID);
355 def_gid_handler(vector strvec)
359 char passwd_buf[1024];
360 struct passwd info, *found;
362 buff = set_value(strvec);
366 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
367 conf->attribute_flags |= (1 << ATTR_GID);
368 conf->gid = info.pw_gid;
370 else if (sscanf(buff, "%u", &gid) == 1){
371 conf->attribute_flags |= (1 << ATTR_GID);
379 def_weight_handler(vector strvec)
383 buff = set_value(strvec);
388 if (strlen(buff) == 10 &&
389 !strcmp(buff, "priorities"))
390 conf->rr_weight = RR_WEIGHT_PRIO;
392 if (strlen(buff) == strlen("uniform") &&
393 !strcmp(buff, "uniform"))
394 conf->rr_weight = RR_WEIGHT_NONE;
402 default_failback_handler(vector strvec)
406 buff = set_value(strvec);
408 if (strlen(buff) == 6 && !strcmp(buff, "manual"))
409 conf->pgfailback = -FAILBACK_MANUAL;
410 else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
411 conf->pgfailback = -FAILBACK_IMMEDIATE;
413 conf->pgfailback = atoi(buff);
421 def_no_path_retry_handler(vector strvec)
425 buff = set_value(strvec);
429 if ((strlen(buff) == 4 && !strcmp(buff, "fail")) ||
430 (strlen(buff) == 1 && !strcmp(buff, "0")))
431 conf->no_path_retry = NO_PATH_RETRY_FAIL;
432 else if (strlen(buff) == 5 && !strcmp(buff, "queue"))
433 conf->no_path_retry = NO_PATH_RETRY_QUEUE;
434 else if ((conf->no_path_retry = atoi(buff)) < 1)
435 conf->no_path_retry = NO_PATH_RETRY_UNDEF;
442 def_queue_without_daemon(vector strvec)
446 buff = set_value(strvec);
450 if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) ||
451 !strncmp(buff, "0", 1))
452 conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
453 else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) ||
454 !strncmp(buff, "1", 1))
455 conf->queue_without_daemon = QUE_NO_DAEMON_ON;
457 conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF;
464 def_checker_timeout_handler(vector strvec)
466 unsigned int checker_timeout;
469 buff = set_value(strvec);
473 if (sscanf(buff, "%u", &checker_timeout) == 1)
474 conf->checker_timeout = checker_timeout;
476 conf->checker_timeout = 0;
483 def_pg_timeout_handler(vector strvec)
488 buff = set_value(strvec);
493 if (strlen(buff) == 4 && !strcmp(buff, "none"))
494 conf->pg_timeout = -PGTIMEOUT_NONE;
495 else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) {
497 conf->pg_timeout = -PGTIMEOUT_NONE;
499 conf->pg_timeout = pg_timeout;
502 conf->pg_timeout = PGTIMEOUT_UNDEF;
509 def_flush_on_last_del_handler(vector strvec)
513 buff = set_value(strvec);
517 if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
518 (strlen(buff) == 1 && strcmp(buff, "0") == 0))
519 conf->flush_on_last_del = FLUSH_DISABLED;
520 if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
521 (strlen(buff) == 1 && strcmp(buff, "1") == 0))
522 conf->flush_on_last_del = FLUSH_ENABLED;
524 conf->flush_on_last_del = FLUSH_UNDEF;
531 def_log_checker_err_handler(vector strvec)
535 buff = set_value(strvec);
540 if (strlen(buff) == 4 && !strcmp(buff, "once"))
541 conf->log_checker_err = LOG_CHKR_ERR_ONCE;
542 else if (strlen(buff) == 6 && !strcmp(buff, "always"))
543 conf->log_checker_err = LOG_CHKR_ERR_ALWAYS;
550 def_reservation_key_handler(vector strvec)
558 buff = set_value(strvec);
564 if (!memcmp("0x",buff, 2))
569 k = strspn(buff, "0123456789aAbBcCdDeEfF");
576 if (1 != sscanf (buff, "%" SCNx64 "", &prkey))
582 if (!conf->reservation_key)
583 conf->reservation_key = (unsigned char *) malloc(8);
585 memset(conf->reservation_key, 0, 8);
587 for (j = 7; j >= 0; --j) {
588 conf->reservation_key[j] = (prkey & 0xff);
597 names_handler(vector strvec)
601 buff = set_value(strvec);
606 if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
607 (strlen(buff) == 1 && !strcmp(buff, "0")))
608 conf->user_friendly_names = 0;
609 else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
610 (strlen(buff) == 1 && !strcmp(buff, "1")))
611 conf->user_friendly_names = 1;
618 bindings_file_handler(vector strvec)
620 conf->bindings_file = set_value(strvec);
622 if (!conf->bindings_file)
629 * blacklist block handlers
632 blacklist_handler(vector strvec)
634 conf->blist_devnode = vector_alloc();
635 conf->blist_wwid = vector_alloc();
636 conf->blist_device = vector_alloc();
638 if (!conf->blist_devnode || !conf->blist_wwid || !conf->blist_device)
645 blacklist_exceptions_handler(vector strvec)
647 conf->elist_devnode = vector_alloc();
648 conf->elist_wwid = vector_alloc();
649 conf->elist_device = vector_alloc();
651 if (!conf->elist_devnode || !conf->elist_wwid || !conf->elist_device)
658 ble_devnode_handler(vector strvec)
662 buff = set_value(strvec);
667 return store_ble(conf->blist_devnode, buff, ORIGIN_CONFIG);
671 ble_except_devnode_handler(vector strvec)
675 buff = set_value(strvec);
680 return store_ble(conf->elist_devnode, buff, ORIGIN_CONFIG);
684 ble_wwid_handler(vector strvec)
688 buff = set_value(strvec);
693 return store_ble(conf->blist_wwid, buff, ORIGIN_CONFIG);
697 ble_except_wwid_handler(vector strvec)
701 buff = set_value(strvec);
706 return store_ble(conf->elist_wwid, buff, ORIGIN_CONFIG);
710 ble_device_handler(vector strvec)
712 return alloc_ble_device(conf->blist_device);
716 ble_except_device_handler(vector strvec)
718 return alloc_ble_device(conf->elist_device);
722 ble_vendor_handler(vector strvec)
726 buff = set_value(strvec);
731 return set_ble_device(conf->blist_device, buff, NULL, ORIGIN_CONFIG);
735 ble_except_vendor_handler(vector strvec)
739 buff = set_value(strvec);
744 return set_ble_device(conf->elist_device, buff, NULL, ORIGIN_CONFIG);
748 ble_product_handler(vector strvec)
752 buff = set_value(strvec);
757 return set_ble_device(conf->blist_device, NULL, buff, ORIGIN_CONFIG);
761 ble_except_product_handler(vector strvec)
765 buff = set_value(strvec);
770 return set_ble_device(conf->elist_device, NULL, buff, ORIGIN_CONFIG);
774 * devices block handlers
777 devices_handler(vector strvec)
780 conf->hwtable = vector_alloc();
789 device_handler(vector strvec)
791 struct hwentry * hwe;
798 if (!vector_alloc_slot(conf->hwtable)) {
802 vector_set_slot(conf->hwtable, hwe);
808 vendor_handler(vector strvec)
810 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
815 hwe->vendor = set_value(strvec);
824 product_handler(vector strvec)
826 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
831 hwe->product = set_value(strvec);
840 revision_handler(vector strvec)
842 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
847 hwe->revision = set_value(strvec);
856 bl_product_handler(vector strvec)
858 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
863 hwe->bl_product = set_value(strvec);
864 if (!hwe->bl_product)
871 hw_fast_io_fail_handler(vector strvec)
874 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
876 buff = set_value(strvec);
877 if (strlen(buff) == 3 && !strcmp(buff, "off"))
878 hwe->fast_io_fail = MP_FAST_IO_FAIL_OFF;
879 else if (sscanf(buff, "%d", &hwe->fast_io_fail) != 1 ||
880 hwe->fast_io_fail < MP_FAST_IO_FAIL_ZERO)
881 hwe->fast_io_fail = 0;
882 else if (hwe->fast_io_fail == 0)
883 hwe->fast_io_fail = MP_FAST_IO_FAIL_ZERO;
890 hw_dev_loss_handler(vector strvec)
893 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
895 buff = set_value(strvec);
899 if (strlen(buff) == 8 && !strcmp(buff, "infinity"))
900 hwe->dev_loss = MAX_DEV_LOSS_TMO;
901 else if (sscanf(buff, "%u", &hwe->dev_loss) != 1)
909 hw_pgpolicy_handler(vector strvec)
912 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
914 buff = set_value(strvec);
919 hwe->pgpolicy = get_pgpolicy_id(buff);
926 hw_uid_attribute_handler(vector strvec)
928 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
930 hwe->uid_attribute = set_value(strvec);
932 if (!hwe->uid_attribute)
939 hw_selector_handler(vector strvec)
941 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
946 hwe->selector = set_value(strvec);
955 hw_path_checker_handler(vector strvec)
957 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
962 hwe->checker_name = set_value(strvec);
964 if (!hwe->checker_name)
971 hw_features_handler(vector strvec)
973 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
978 hwe->features = set_value(strvec);
987 hw_handler_handler(vector strvec)
989 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
994 hwe->hwhandler = set_value(strvec);
1003 hw_prio_handler(vector strvec)
1005 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1010 hwe->prio_name = set_value(strvec);
1012 if (!hwe->prio_name)
1019 hw_alias_prefix_handler(vector strvec)
1021 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1026 hwe->alias_prefix = set_value(strvec);
1028 if (!hwe->alias_prefix)
1035 hw_prio_args_handler(vector strvec)
1037 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1042 hwe->prio_args = set_value(strvec);
1044 if (!hwe->prio_args)
1051 hw_failback_handler(vector strvec)
1053 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1059 buff = set_value(strvec);
1061 if (strlen(buff) == 6 && !strcmp(buff, "manual"))
1062 hwe->pgfailback = -FAILBACK_MANUAL;
1063 else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
1064 hwe->pgfailback = -FAILBACK_IMMEDIATE;
1066 hwe->pgfailback = atoi(buff);
1074 hw_weight_handler(vector strvec)
1076 struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
1082 buff = set_value(strvec);
1087 if (strlen(buff) == 10 &&
1088 !strcmp(buff, "priorities"))
1089 hwe->rr_weight = RR_WEIGHT_PRIO;
1091 if (strlen(buff) == strlen("uniform") &&
1092 !strcmp(buff, "uniform"))
1093 hwe->rr_weight = RR_WEIGHT_NONE;
1101 hw_no_path_retry_handler(vector strvec)
1103 struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
1109 buff = set_value(strvec);
1113 if ((strlen(buff) == 4 && !strcmp(buff, "fail")) ||
1114 (strlen(buff) == 1 && !strcmp(buff, "0")))
1115 hwe->no_path_retry = NO_PATH_RETRY_FAIL;
1116 else if (strlen(buff) == 5 && !strcmp(buff, "queue"))
1117 hwe->no_path_retry = NO_PATH_RETRY_QUEUE;
1118 else if ((hwe->no_path_retry = atoi(buff)) < 1)
1119 hwe->no_path_retry = NO_PATH_RETRY_UNDEF;
1126 hw_minio_handler(vector strvec)
1128 struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
1134 buff = set_value(strvec);
1139 hwe->minio = atoi(buff);
1146 hw_minio_rq_handler(vector strvec)
1148 struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
1154 buff = set_value(strvec);
1159 hwe->minio_rq = atoi(buff);
1166 hw_pg_timeout_handler(vector strvec)
1169 struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
1175 buff = set_value(strvec);
1180 if (strlen(buff) == 4 && !strcmp(buff, "none"))
1181 hwe->pg_timeout = -PGTIMEOUT_NONE;
1182 else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) {
1183 if (pg_timeout == 0)
1184 hwe->pg_timeout = -PGTIMEOUT_NONE;
1186 hwe->pg_timeout = pg_timeout;
1189 hwe->pg_timeout = PGTIMEOUT_UNDEF;
1196 hw_flush_on_last_del_handler(vector strvec)
1198 struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
1204 buff = set_value(strvec);
1208 if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
1209 (strlen(buff) == 1 && strcmp(buff, "0") == 0))
1210 hwe->flush_on_last_del = FLUSH_DISABLED;
1211 if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
1212 (strlen(buff) == 1 && strcmp(buff, "1") == 0))
1213 hwe->flush_on_last_del = FLUSH_ENABLED;
1215 hwe->flush_on_last_del = FLUSH_UNDEF;
1222 * multipaths block handlers
1225 multipaths_handler(vector strvec)
1227 conf->mptable = vector_alloc();
1236 multipath_handler(vector strvec)
1238 struct mpentry * mpe;
1245 if (!vector_alloc_slot(conf->mptable)) {
1249 vector_set_slot(conf->mptable, mpe);
1255 wwid_handler(vector strvec)
1257 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1262 mpe->wwid = set_value(strvec);
1271 alias_handler(vector strvec)
1273 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1278 mpe->alias = set_value(strvec);
1287 mp_pgpolicy_handler(vector strvec)
1290 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1295 buff = set_value(strvec);
1300 mpe->pgpolicy = get_pgpolicy_id(buff);
1307 mp_selector_handler(vector strvec)
1309 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1314 mpe->selector = set_value(strvec);
1323 mp_failback_handler(vector strvec)
1325 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1331 buff = set_value(strvec);
1333 if (strlen(buff) == 6 && !strcmp(buff, "manual"))
1334 mpe->pgfailback = -FAILBACK_MANUAL;
1335 else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
1336 mpe->pgfailback = -FAILBACK_IMMEDIATE;
1338 mpe->pgfailback = atoi(buff);
1346 mp_mode_handler(vector strvec)
1349 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1355 buff = set_value(strvec);
1358 if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777) {
1359 mpe->attribute_flags |= (1 << ATTR_MODE);
1368 mp_uid_handler(vector strvec)
1372 char passwd_buf[1024];
1373 struct passwd info, *found;
1375 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1380 buff = set_value(strvec);
1384 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
1385 mpe->attribute_flags |= (1 << ATTR_UID);
1386 mpe->uid = info.pw_uid;
1388 else if (sscanf(buff, "%u", &uid) == 1){
1389 mpe->attribute_flags |= (1 << ATTR_UID);
1397 mp_gid_handler(vector strvec)
1401 char passwd_buf[1024];
1402 struct passwd info, *found;
1404 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1409 buff = set_value(strvec);
1413 if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
1414 mpe->attribute_flags |= (1 << ATTR_GID);
1415 mpe->gid = info.pw_gid;
1417 else if (sscanf(buff, "%u", &gid) == 1) {
1418 mpe->attribute_flags |= (1 << ATTR_GID);
1426 mp_weight_handler(vector strvec)
1428 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1434 buff = set_value(strvec);
1439 if (strlen(buff) == 10 &&
1440 !strcmp(buff, "priorities"))
1441 mpe->rr_weight = RR_WEIGHT_PRIO;
1443 if (strlen(buff) == strlen("uniform") &&
1444 !strcmp(buff, "uniform"))
1445 mpe->rr_weight = RR_WEIGHT_NONE;
1453 mp_no_path_retry_handler(vector strvec)
1455 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1461 buff = set_value(strvec);
1465 if ((strlen(buff) == 4 && !strcmp(buff, "fail")) ||
1466 (strlen(buff) == 1 && !strcmp(buff, "0")))
1467 mpe->no_path_retry = NO_PATH_RETRY_FAIL;
1468 else if (strlen(buff) == 5 && !strcmp(buff, "queue"))
1469 mpe->no_path_retry = NO_PATH_RETRY_QUEUE;
1470 else if ((mpe->no_path_retry = atoi(buff)) < 1)
1471 mpe->no_path_retry = NO_PATH_RETRY_UNDEF;
1478 mp_minio_handler(vector strvec)
1480 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1486 buff = set_value(strvec);
1491 mpe->minio = atoi(buff);
1498 mp_minio_rq_handler(vector strvec)
1500 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1506 buff = set_value(strvec);
1511 mpe->minio_rq = atoi(buff);
1518 mp_pg_timeout_handler(vector strvec)
1521 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1527 buff = set_value(strvec);
1531 if (strlen(buff) == 4 && !strcmp(buff, "none"))
1532 mpe->pg_timeout = -PGTIMEOUT_NONE;
1533 else if (sscanf(buff, "%d", &pg_timeout) == 1 && pg_timeout >= 0) {
1534 if (pg_timeout == 0)
1535 mpe->pg_timeout = -PGTIMEOUT_NONE;
1537 mpe->pg_timeout = pg_timeout;
1540 mpe->pg_timeout = PGTIMEOUT_UNDEF;
1547 mp_features_handler(vector strvec)
1549 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
1554 mpe->features = set_value(strvec);
1563 mp_flush_on_last_del_handler(vector strvec)
1565 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1571 buff = set_value(strvec);
1575 if ((strlen(buff) == 2 && strcmp(buff, "no") == 0) ||
1576 (strlen(buff) == 1 && strcmp(buff, "0") == 0))
1577 mpe->flush_on_last_del = FLUSH_DISABLED;
1578 if ((strlen(buff) == 3 && strcmp(buff, "yes") == 0) ||
1579 (strlen(buff) == 1 && strcmp(buff, "1") == 0))
1580 mpe->flush_on_last_del = FLUSH_ENABLED;
1582 mpe->flush_on_last_del = FLUSH_UNDEF;
1589 mp_prio_handler(vector strvec)
1591 struct mpentry * mpe = VECTOR_LAST_SLOT(conf->hwtable);
1596 mpe->prio_name = set_value(strvec);
1598 if (!mpe->prio_name)
1605 mp_prio_args_handler (vector strvec)
1607 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1612 mpe->prio_args = set_value(strvec);
1613 if (!mpe->prio_args)
1620 mp_reservation_key_handler (vector strvec)
1624 struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
1632 buff = set_value(strvec);
1637 if (!memcmp(buff, "0x", 2))
1642 k = strspn(buff, "0123456789aAbBcCdDeEfF");
1648 if (1 != sscanf (buff, "%" SCNx64 "", &prkey))
1654 if (!mpe->reservation_key)
1655 mpe->reservation_key = (unsigned char *) malloc(8);
1657 memset(mpe->reservation_key, 0, 8);
1659 for (j = 7; j >= 0; --j) {
1660 mpe->reservation_key[j] = (prkey & 0xff);
1670 * config file keywords printing
1673 snprint_mp_wwid (char * buff, int len, void * data)
1675 struct mpentry * mpe = (struct mpentry *)data;
1677 return snprintf(buff, len, "%s", mpe->wwid);
1681 snprint_mp_alias (char * buff, int len, void * data)
1683 struct mpentry * mpe = (struct mpentry *)data;
1688 return snprintf(buff, len, "%s", mpe->alias);
1692 snprint_mp_path_grouping_policy (char * buff, int len, void * data)
1694 struct mpentry * mpe = (struct mpentry *)data;
1695 char str[POLICY_NAME_SIZE];
1699 get_pgpolicy_name(str, POLICY_NAME_SIZE, mpe->pgpolicy);
1701 return snprintf(buff, len, "%s", str);
1705 snprint_mp_selector (char * buff, int len, void * data)
1707 struct mpentry * mpe = (struct mpentry *)data;
1712 return snprintf(buff, len, "\"%s\"", mpe->selector);
1716 snprint_mp_failback (char * buff, int len, void * data)
1718 struct mpentry * mpe = (struct mpentry *)data;
1720 if (!mpe->pgfailback)
1723 switch(mpe->pgfailback) {
1724 case FAILBACK_UNDEF:
1726 case -FAILBACK_MANUAL:
1727 return snprintf(buff, len, "manual");
1728 case -FAILBACK_IMMEDIATE:
1729 return snprintf(buff, len, "immediate");
1731 return snprintf(buff, len, "%i", mpe->pgfailback);
1737 snprint_mp_mode(char * buff, int len, void * data)
1739 struct mpentry * mpe = (struct mpentry *)data;
1741 if ((mpe->attribute_flags & (1 << ATTR_MODE)) == 0)
1743 return snprintf(buff, len, "0%o", mpe->mode);
1747 snprint_mp_uid(char * buff, int len, void * data)
1749 struct mpentry * mpe = (struct mpentry *)data;
1751 if ((mpe->attribute_flags & (1 << ATTR_UID)) == 0)
1753 return snprintf(buff, len, "0%o", mpe->uid);
1757 snprint_mp_gid(char * buff, int len, void * data)
1759 struct mpentry * mpe = (struct mpentry *)data;
1761 if ((mpe->attribute_flags & (1 << ATTR_GID)) == 0)
1763 return snprintf(buff, len, "0%o", mpe->gid);
1767 snprint_mp_rr_weight (char * buff, int len, void * data)
1769 struct mpentry * mpe = (struct mpentry *)data;
1771 if (!mpe->rr_weight)
1773 if (mpe->rr_weight == RR_WEIGHT_PRIO)
1774 return snprintf(buff, len, "priorities");
1775 if (mpe->rr_weight == RR_WEIGHT_NONE)
1776 return snprintf(buff, len, "uniform");
1782 snprint_mp_no_path_retry (char * buff, int len, void * data)
1784 struct mpentry * mpe = (struct mpentry *)data;
1786 if (!mpe->no_path_retry)
1789 switch(mpe->no_path_retry) {
1790 case NO_PATH_RETRY_UNDEF:
1792 case NO_PATH_RETRY_FAIL:
1793 return snprintf(buff, len, "fail");
1794 case NO_PATH_RETRY_QUEUE:
1795 return snprintf(buff, len, "queue");
1797 return snprintf(buff, len, "%i",
1798 mpe->no_path_retry);
1804 snprint_mp_rr_min_io (char * buff, int len, void * data)
1806 struct mpentry * mpe = (struct mpentry *)data;
1811 return snprintf(buff, len, "%u", mpe->minio);
1815 snprint_mp_rr_min_io_rq (char * buff, int len, void * data)
1817 struct mpentry * mpe = (struct mpentry *)data;
1822 return snprintf(buff, len, "%u", mpe->minio_rq);
1826 snprint_mp_pg_timeout (char * buff, int len, void * data)
1828 struct mpentry * mpe = (struct mpentry *)data;
1830 switch (mpe->pg_timeout) {
1831 case PGTIMEOUT_UNDEF:
1833 case -PGTIMEOUT_NONE:
1834 return snprintf(buff, len, "none");
1836 return snprintf(buff, len, "%i", mpe->pg_timeout);
1842 snprint_mp_features (char * buff, int len, void * data)
1844 struct mpentry * mpe = (struct mpentry *)data;
1848 if (strlen(mpe->features) == strlen(conf->features) &&
1849 !strcmp(mpe->features, conf->features))
1852 return snprintf(buff, len, "%s", mpe->features);
1856 snprint_mp_flush_on_last_del (char * buff, int len, void * data)
1858 struct mpentry * mpe = (struct mpentry *)data;
1860 switch (mpe->flush_on_last_del) {
1861 case FLUSH_DISABLED:
1862 return snprintf(buff, len, "no");
1864 return snprintf(buff, len, "yes");
1870 snprint_mp_prio(char * buff, int len, void * data)
1872 struct mpentry * mpe = (struct mpentry *)data;
1874 if (!mpe->prio_name)
1877 return snprintf(buff, len, "%s", mpe->prio_name);
1881 snprint_mp_prio_args(char * buff, int len, void * data)
1883 struct mpentry * mpe = (struct mpentry *)data;
1885 if (!mpe->prio_args)
1888 return snprintf(buff, len, "%s", mpe->prio_args);
1892 snprint_mp_reservation_key (char * buff, int len, void * data)
1894 struct mpentry * mpe = (struct mpentry *)data;
1895 return snprintf(buff, len, "%s" , mpe->reservation_key);
1900 snprint_hw_fast_io_fail(char * buff, int len, void * data)
1902 struct hwentry * hwe = (struct hwentry *)data;
1903 if (!hwe->fast_io_fail)
1905 if (hwe->fast_io_fail == conf->fast_io_fail)
1907 if (hwe->fast_io_fail == MP_FAST_IO_FAIL_OFF)
1908 return snprintf(buff, len, "off");
1909 if (hwe->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
1910 return snprintf(buff, len, "0");
1911 return snprintf(buff, len, "%d", hwe->fast_io_fail);
1915 snprint_hw_dev_loss(char * buff, int len, void * data)
1917 struct hwentry * hwe = (struct hwentry *)data;
1920 if (hwe->dev_loss == conf->dev_loss)
1922 if (hwe->dev_loss >= MAX_DEV_LOSS_TMO)
1923 return snprintf(buff, len, "infinity");
1925 return snprintf(buff, len, "%u", hwe->dev_loss);
1929 snprint_hw_vendor (char * buff, int len, void * data)
1931 struct hwentry * hwe = (struct hwentry *)data;
1936 return snprintf(buff, len, "\"%s\"", hwe->vendor);
1940 snprint_hw_product (char * buff, int len, void * data)
1942 struct hwentry * hwe = (struct hwentry *)data;
1947 return snprintf(buff, len, "\"%s\"", hwe->product);
1951 snprint_hw_revision (char * buff, int len, void * data)
1953 struct hwentry * hwe = (struct hwentry *)data;
1958 return snprintf(buff, len, "\"%s\"", hwe->revision);
1962 snprint_hw_bl_product (char * buff, int len, void * data)
1964 struct hwentry * hwe = (struct hwentry *)data;
1966 if (!hwe->bl_product)
1969 return snprintf(buff, len, "\"%s\"", hwe->bl_product);
1973 snprint_hw_uid_attribute (char * buff, int len, void * data)
1975 struct hwentry * hwe = (struct hwentry *)data;
1977 if (!hwe->uid_attribute)
1980 return snprintf(buff, len, "\"%s\"", hwe->uid_attribute);
1984 snprint_hw_prio (char * buff, int len, void * data)
1986 struct hwentry * hwe = (struct hwentry *)data;
1988 if (!hwe->prio_name)
1991 return snprintf(buff, len, "%s", hwe->prio_name);
1995 snprint_hw_alias_prefix (char * buff, int len, void * data)
1997 struct hwentry * hwe = (struct hwentry *)data;
1999 if (!hwe->alias_prefix)
2002 return snprintf(buff, len, "\"%s\"", hwe->alias_prefix);
2006 snprint_hw_prio_args (char * buff, int len, void * data)
2008 struct hwentry * hwe = (struct hwentry *)data;
2010 if (!hwe->prio_args)
2013 return snprintf(buff, len, "\"%s\"", hwe->prio_args);
2017 snprint_hw_features (char * buff, int len, void * data)
2019 struct hwentry * hwe = (struct hwentry *)data;
2024 return snprintf(buff, len, "\"%s\"", hwe->features);
2028 snprint_hw_hardware_handler (char * buff, int len, void * data)
2030 struct hwentry * hwe = (struct hwentry *)data;
2032 if (!hwe->hwhandler)
2035 return snprintf(buff, len, "\"%s\"", hwe->hwhandler);
2039 snprint_hw_selector (char * buff, int len, void * data)
2041 struct hwentry * hwe = (struct hwentry *)data;
2046 return snprintf(buff, len, "\"%s\"", hwe->selector);
2050 snprint_hw_path_grouping_policy (char * buff, int len, void * data)
2052 struct hwentry * hwe = (struct hwentry *)data;
2054 char str[POLICY_NAME_SIZE];
2059 get_pgpolicy_name(str, POLICY_NAME_SIZE, hwe->pgpolicy);
2061 return snprintf(buff, len, "%s", str);
2065 snprint_hw_failback (char * buff, int len, void * data)
2067 struct hwentry * hwe = (struct hwentry *)data;
2069 if (!hwe->pgfailback)
2072 switch(hwe->pgfailback) {
2073 case FAILBACK_UNDEF:
2075 case -FAILBACK_MANUAL:
2076 return snprintf(buff, len, "manual");
2077 case -FAILBACK_IMMEDIATE:
2078 return snprintf(buff, len, "immediate");
2080 return snprintf(buff, len, "%i", hwe->pgfailback);
2086 snprint_hw_rr_weight (char * buff, int len, void * data)
2088 struct hwentry * hwe = (struct hwentry *)data;
2090 if (!hwe->rr_weight)
2092 if (hwe->rr_weight == RR_WEIGHT_PRIO)
2093 return snprintf(buff, len, "priorities");
2094 if (hwe->rr_weight == RR_WEIGHT_NONE)
2095 return snprintf(buff, len, "uniform");
2101 snprint_hw_no_path_retry (char * buff, int len, void * data)
2103 struct hwentry * hwe = (struct hwentry *)data;
2105 if (!hwe->no_path_retry)
2108 switch(hwe->no_path_retry) {
2109 case NO_PATH_RETRY_UNDEF:
2111 case NO_PATH_RETRY_FAIL:
2112 return snprintf(buff, len, "fail");
2113 case NO_PATH_RETRY_QUEUE:
2114 return snprintf(buff, len, "queue");
2116 return snprintf(buff, len, "%i",
2117 hwe->no_path_retry);
2123 snprint_hw_rr_min_io (char * buff, int len, void * data)
2125 struct hwentry * hwe = (struct hwentry *)data;
2130 return snprintf(buff, len, "%u", hwe->minio);
2134 snprint_hw_rr_min_io_rq (char * buff, int len, void * data)
2136 struct hwentry * hwe = (struct hwentry *)data;
2141 return snprintf(buff, len, "%u", hwe->minio_rq);
2145 snprint_hw_pg_timeout (char * buff, int len, void * data)
2147 struct hwentry * hwe = (struct hwentry *)data;
2149 if (!hwe->pg_timeout)
2152 switch (hwe->pg_timeout) {
2153 case PGTIMEOUT_UNDEF:
2155 case -PGTIMEOUT_NONE:
2156 return snprintf(buff, len, "none");
2158 return snprintf(buff, len, "%i", hwe->pg_timeout);
2164 snprint_hw_flush_on_last_del (char * buff, int len, void * data)
2166 struct hwentry * hwe = (struct hwentry *)data;
2168 switch (hwe->flush_on_last_del) {
2169 case FLUSH_DISABLED:
2170 return snprintf(buff, len, "no");
2172 return snprintf(buff, len, "yes");
2178 snprint_hw_path_checker (char * buff, int len, void * data)
2180 struct hwentry * hwe = (struct hwentry *)data;
2182 if (!hwe->checker_name)
2185 return snprintf(buff, len, "%s", hwe->checker_name);
2189 snprint_def_polling_interval (char * buff, int len, void * data)
2191 return snprintf(buff, len, "%i", conf->checkint);
2195 snprint_def_fast_io_fail(char * buff, int len, void * data)
2197 if (!conf->fast_io_fail)
2199 if (conf->fast_io_fail == MP_FAST_IO_FAIL_OFF)
2200 return snprintf(buff, len, "off");
2201 if (conf->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
2202 return snprintf(buff, len, "0");
2203 return snprintf(buff, len, "%d", conf->fast_io_fail);
2207 snprint_def_dev_loss(char * buff, int len, void * data)
2209 if (!conf->dev_loss)
2211 if (conf->dev_loss >= MAX_DEV_LOSS_TMO)
2212 return snprintf(buff, len, "infinity");
2213 return snprintf(buff, len, "%u", conf->dev_loss);
2217 snprint_def_verbosity (char * buff, int len, void * data)
2219 return snprintf(buff, len, "%i", conf->verbosity);
2223 snprint_def_max_polling_interval (char * buff, int len, void * data)
2225 if (conf->max_checkint == MAX_CHECKINT(conf->checkint))
2227 return snprintf(buff, len, "%i", conf->max_checkint);
2231 snprint_reassign_maps (char * buff, int len, void * data)
2233 if (conf->reassign_maps == DEFAULT_REASSIGN_MAPS)
2235 return snprintf(buff, len, "%s",
2236 conf->reassign_maps?"yes":"no");
2240 snprint_def_udev_dir (char * buff, int len, void * data)
2242 if (!conf->udev_dir)
2245 return snprintf(buff, len, "\"%s\"", conf->udev_dir);
2249 snprint_def_multipath_dir (char * buff, int len, void * data)
2251 if (!conf->udev_dir)
2254 return snprintf(buff, len, "\"%s\"", conf->multipath_dir);
2258 snprint_def_selector (char * buff, int len, void * data)
2260 if (!conf->selector)
2261 return snprintf(buff, len, "\"%s\"", DEFAULT_SELECTOR);
2263 return snprintf(buff, len, "\"%s\"", conf->selector);
2267 snprint_def_path_grouping_policy (char * buff, int len, void * data)
2269 char str[POLICY_NAME_SIZE];
2270 int pgpolicy = conf->pgpolicy;
2273 pgpolicy = DEFAULT_PGPOLICY;
2275 get_pgpolicy_name(str, POLICY_NAME_SIZE, pgpolicy);
2277 return snprintf(buff, len, "%s", str);
2281 snprint_def_uid_attribute (char * buff, int len, void * data)
2283 if (!conf->uid_attribute)
2284 return snprintf(buff, len, "\"%s\"", DEFAULT_UID_ATTRIBUTE);
2286 return snprintf(buff, len, "\"%s\"", conf->uid_attribute);
2290 snprint_def_prio (char * buff, int len, void * data)
2292 if (!conf->prio_name)
2293 return snprintf(buff, len, "%s", DEFAULT_PRIO);
2295 return snprintf(buff, len, "%s", conf->prio_name);
2299 snprint_def_prio_args (char * buff, int len, void * data)
2301 if (!conf->prio_args)
2302 return snprintf(buff, len, "\"%s\"", DEFAULT_PRIO_ARGS);
2304 return snprintf(buff, len, "\"%s\"", conf->prio_args);
2308 snprint_def_features (char * buff, int len, void * data)
2310 if (!conf->features)
2311 return snprintf(buff, len, "\"%s\"", DEFAULT_FEATURES);
2313 return snprintf(buff, len, "\"%s\"", conf->features);
2317 snprint_def_path_checker (char * buff, int len, void * data)
2319 if (!conf->checker_name)
2320 return snprintf(buff, len, "%s", DEFAULT_CHECKER);
2322 return snprintf(buff, len, "%s", conf->checker_name);
2326 snprint_def_failback (char * buff, int len, void * data)
2328 int pgfailback = conf->pgfailback;
2330 pgfailback = DEFAULT_FAILBACK;
2332 switch(conf->pgfailback) {
2333 case FAILBACK_UNDEF:
2335 case -FAILBACK_MANUAL:
2336 return snprintf(buff, len, "manual");
2337 case -FAILBACK_IMMEDIATE:
2338 return snprintf(buff, len, "immediate");
2340 return snprintf(buff, len, "%i", conf->pgfailback);
2346 snprint_def_rr_min_io (char * buff, int len, void * data)
2351 return snprintf(buff, len, "%u", conf->minio);
2355 snprint_def_rr_min_io_rq (char * buff, int len, void * data)
2357 if (!conf->minio_rq)
2360 return snprintf(buff, len, "%u", conf->minio_rq);
2364 snprint_max_fds (char * buff, int len, void * data)
2369 return snprintf(buff, len, "%d", conf->max_fds);
2373 snprint_def_mode(char * buff, int len, void * data)
2375 if ((conf->attribute_flags & (1 << ATTR_MODE)) == 0)
2377 return snprintf(buff, len, "0%o", conf->mode);
2381 snprint_def_uid(char * buff, int len, void * data)
2383 if ((conf->attribute_flags & (1 << ATTR_UID)) == 0)
2385 return snprintf(buff, len, "0%o", conf->uid);
2389 snprint_def_gid(char * buff, int len, void * data)
2391 if ((conf->attribute_flags & (1 << ATTR_GID)) == 0)
2393 return snprintf(buff, len, "0%o", conf->gid);
2397 snprint_def_rr_weight (char * buff, int len, void * data)
2399 if (!conf->rr_weight || conf->rr_weight == RR_WEIGHT_NONE)
2400 return snprintf(buff, len, "uniform");
2401 if (conf->rr_weight == RR_WEIGHT_PRIO)
2402 return snprintf(buff, len, "priorities");
2408 snprint_def_no_path_retry (char * buff, int len, void * data)
2410 switch(conf->no_path_retry) {
2411 case NO_PATH_RETRY_UNDEF:
2413 case NO_PATH_RETRY_FAIL:
2414 return snprintf(buff, len, "fail");
2415 case NO_PATH_RETRY_QUEUE:
2416 return snprintf(buff, len, "queue");
2418 return snprintf(buff, len, "%i",
2419 conf->no_path_retry);
2425 snprint_def_queue_without_daemon (char * buff, int len, void * data)
2427 switch (conf->queue_without_daemon) {
2428 case QUE_NO_DAEMON_OFF:
2429 return snprintf(buff, len, "no");
2430 case QUE_NO_DAEMON_ON:
2431 case QUE_NO_DAEMON_UNDEF:
2432 return snprintf(buff, len, "yes");
2438 snprint_def_checker_timeout (char *buff, int len, void *data)
2440 if (!conf->checker_timeout)
2443 return snprintf(buff, len, "%u", conf->checker_timeout);
2447 snprint_def_pg_timeout (char * buff, int len, void * data)
2449 switch (conf->pg_timeout) {
2450 case PGTIMEOUT_UNDEF:
2451 case -PGTIMEOUT_NONE:
2452 return snprintf(buff, len, "none");
2454 return snprintf(buff, len, "%i", conf->pg_timeout);
2460 snprint_def_flush_on_last_del (char * buff, int len, void * data)
2462 switch (conf->flush_on_last_del) {
2464 case FLUSH_DISABLED:
2465 return snprintf(buff, len, "no");
2467 case FLUSH_IN_PROGRESS:
2468 return snprintf(buff, len, "yes");
2474 snprint_def_log_checker_err (char * buff, int len, void * data)
2476 if (conf->log_checker_err == LOG_CHKR_ERR_ONCE)
2477 return snprintf(buff, len, "once");
2478 return snprintf(buff, len, "always");
2482 snprint_def_user_friendly_names (char * buff, int len, void * data)
2484 if (!conf->user_friendly_names)
2485 return snprintf(buff, len, "no");
2487 return snprintf(buff, len, "yes");
2491 snprint_def_alias_prefix (char * buff, int len, void * data)
2493 if (!conf->alias_prefix)
2494 return snprintf(buff, len, "\"%s\"", DEFAULT_ALIAS_PREFIX);
2495 return snprintf(buff, len, "\"%s\"", conf->alias_prefix);
2499 snprint_def_bindings_file (char * buff, int len, void * data)
2501 if (conf->bindings_file == NULL)
2503 if (strlen(conf->bindings_file) == strlen(DEFAULT_BINDINGS_FILE) &&
2504 !strcmp(conf->bindings_file, DEFAULT_BINDINGS_FILE))
2507 return snprintf(buff, len, "%s", conf->bindings_file);
2511 snprint_def_reservation_key(char * buff, int len, void * data)
2513 return snprintf(buff, len, "%s", conf->reservation_key);
2517 snprint_ble_simple (char * buff, int len, void * data)
2519 struct blentry * ble = (struct blentry *)data;
2521 return snprintf(buff, len, "\"%s\"", ble->str);
2525 snprint_bled_vendor (char * buff, int len, void * data)
2527 struct blentry_device * bled = (struct blentry_device *)data;
2529 return snprintf(buff, len, "\"%s\"", bled->vendor);
2533 snprint_bled_product (char * buff, int len, void * data)
2535 struct blentry_device * bled = (struct blentry_device *)data;
2537 return snprintf(buff, len, "\"%s\"", bled->product);
2540 #define __deprecated
2545 install_keyword_root("defaults", NULL);
2546 install_keyword("verbosity", &verbosity_handler, &snprint_def_verbosity);
2547 install_keyword("polling_interval", &polling_interval_handler, &snprint_def_polling_interval);
2548 install_keyword("max_polling_interval", &max_polling_interval_handler, &snprint_def_max_polling_interval);
2549 install_keyword("reassign_maps", &reassign_maps_handler, &snprint_reassign_maps);
2550 install_keyword("udev_dir", &udev_dir_handler, &snprint_def_udev_dir);
2551 install_keyword("multipath_dir", &multipath_dir_handler, &snprint_def_multipath_dir);
2552 install_keyword("path_selector", &def_selector_handler, &snprint_def_selector);
2553 install_keyword("path_grouping_policy", &def_pgpolicy_handler, &snprint_def_path_grouping_policy);
2554 install_keyword("uid_attribute", &def_uid_attribute_handler, &snprint_def_uid_attribute);
2555 install_keyword("prio", &def_prio_handler, &snprint_def_prio);
2556 install_keyword("prio_args", &def_prio_args_handler, &snprint_def_prio_args);
2557 install_keyword("features", &def_features_handler, &snprint_def_features);
2558 install_keyword("path_checker", &def_path_checker_handler, &snprint_def_path_checker);
2559 install_keyword("checker", &def_path_checker_handler, NULL);
2560 install_keyword("alias_prefix", &def_alias_prefix_handler, &snprint_def_alias_prefix);
2561 install_keyword("failback", &default_failback_handler, &snprint_def_failback);
2562 install_keyword("rr_min_io", &def_minio_handler, &snprint_def_rr_min_io);
2563 install_keyword("rr_min_io_rq", &def_minio_rq_handler, &snprint_def_rr_min_io_rq);
2564 install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
2565 install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
2566 install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
2567 install_keyword("queue_without_daemon", &def_queue_without_daemon, &snprint_def_queue_without_daemon);
2568 install_keyword("checker_timeout", &def_checker_timeout_handler, &snprint_def_checker_timeout);
2569 install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
2570 install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
2571 install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names);
2572 install_keyword("mode", &def_mode_handler, &snprint_def_mode);
2573 install_keyword("uid", &def_uid_handler, &snprint_def_uid);
2574 install_keyword("gid", &def_gid_handler, &snprint_def_gid);
2575 install_keyword("fast_io_fail_tmo", &def_fast_io_fail_handler, &snprint_def_fast_io_fail);
2576 install_keyword("dev_loss_tmo", &def_dev_loss_handler, &snprint_def_dev_loss);
2577 install_keyword("bindings_file", &bindings_file_handler, &snprint_def_bindings_file);
2578 install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
2579 install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
2580 __deprecated install_keyword("default_selector", &def_selector_handler, NULL);
2581 __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
2582 __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
2583 __deprecated install_keyword("default_features", &def_features_handler, NULL);
2584 __deprecated install_keyword("default_path_checker", &def_path_checker_handler, NULL);
2586 install_keyword_root("blacklist", &blacklist_handler);
2587 install_keyword_multi("devnode", &ble_devnode_handler, &snprint_ble_simple);
2588 install_keyword_multi("wwid", &ble_wwid_handler, &snprint_ble_simple);
2589 install_keyword_multi("device", &ble_device_handler, NULL);
2591 install_keyword("vendor", &ble_vendor_handler, &snprint_bled_vendor);
2592 install_keyword("product", &ble_product_handler, &snprint_bled_product);
2593 install_sublevel_end();
2594 install_keyword_root("blacklist_exceptions", &blacklist_exceptions_handler);
2595 install_keyword_multi("devnode", &ble_except_devnode_handler, &snprint_ble_simple);
2596 install_keyword_multi("wwid", &ble_except_wwid_handler, &snprint_ble_simple);
2597 install_keyword_multi("device", &ble_except_device_handler, NULL);
2599 install_keyword("vendor", &ble_except_vendor_handler, &snprint_bled_vendor);
2600 install_keyword("product", &ble_except_product_handler, &snprint_bled_product);
2601 install_sublevel_end();
2604 __deprecated install_keyword_root("devnode_blacklist", &blacklist_handler);
2605 __deprecated install_keyword("devnode", &ble_devnode_handler, &snprint_ble_simple);
2606 __deprecated install_keyword("wwid", &ble_wwid_handler, &snprint_ble_simple);
2607 __deprecated install_keyword("device", &ble_device_handler, NULL);
2608 __deprecated install_sublevel();
2609 __deprecated install_keyword("vendor", &ble_vendor_handler, &snprint_bled_vendor);
2610 __deprecated install_keyword("product", &ble_product_handler, &snprint_bled_product);
2611 __deprecated install_sublevel_end();
2614 install_keyword_root("devices", &devices_handler);
2615 install_keyword_multi("device", &device_handler, NULL);
2617 install_keyword("vendor", &vendor_handler, &snprint_hw_vendor);
2618 install_keyword("product", &product_handler, &snprint_hw_product);
2619 install_keyword("revision", &revision_handler, &snprint_hw_revision);
2620 install_keyword("product_blacklist", &bl_product_handler, &snprint_hw_bl_product);
2621 install_keyword("path_grouping_policy", &hw_pgpolicy_handler, &snprint_hw_path_grouping_policy);
2622 install_keyword("uid_attribute", &hw_uid_attribute_handler, &snprint_hw_uid_attribute);
2623 install_keyword("path_selector", &hw_selector_handler, &snprint_hw_selector);
2624 install_keyword("path_checker", &hw_path_checker_handler, &snprint_hw_path_checker);
2625 install_keyword("checker", &hw_path_checker_handler, NULL);
2626 install_keyword("alias_prefix", &hw_alias_prefix_handler, &snprint_hw_alias_prefix);
2627 install_keyword("features", &hw_features_handler, &snprint_hw_features);
2628 install_keyword("hardware_handler", &hw_handler_handler, &snprint_hw_hardware_handler);
2629 install_keyword("prio", &hw_prio_handler, &snprint_hw_prio);
2630 install_keyword("prio_args", &hw_prio_args_handler, &snprint_hw_prio_args);
2631 install_keyword("failback", &hw_failback_handler, &snprint_hw_failback);
2632 install_keyword("rr_weight", &hw_weight_handler, &snprint_hw_rr_weight);
2633 install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
2634 install_keyword("rr_min_io", &hw_minio_handler, &snprint_hw_rr_min_io);
2635 install_keyword("rr_min_io_rq", &hw_minio_rq_handler, &snprint_hw_rr_min_io_rq);
2636 install_keyword("pg_timeout", &hw_pg_timeout_handler, &snprint_hw_pg_timeout);
2637 install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler, &snprint_hw_flush_on_last_del);
2638 install_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
2639 install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
2640 install_sublevel_end();
2642 install_keyword_root("multipaths", &multipaths_handler);
2643 install_keyword_multi("multipath", &multipath_handler, NULL);
2645 install_keyword("wwid", &wwid_handler, &snprint_mp_wwid);
2646 install_keyword("alias", &alias_handler, &snprint_mp_alias);
2647 install_keyword("path_grouping_policy", &mp_pgpolicy_handler, &snprint_mp_path_grouping_policy);
2648 install_keyword("path_selector", &mp_selector_handler, &snprint_mp_selector);
2649 install_keyword("prio", &mp_prio_handler, &snprint_mp_prio);
2650 install_keyword("prio_args", &mp_prio_args_handler, &snprint_mp_prio_args);
2651 install_keyword("failback", &mp_failback_handler, &snprint_mp_failback);
2652 install_keyword("rr_weight", &mp_weight_handler, &snprint_mp_rr_weight);
2653 install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
2654 install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_rr_min_io);
2655 install_keyword("rr_min_io_rq", &mp_minio_rq_handler, &snprint_mp_rr_min_io_rq);
2656 install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
2657 install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
2658 install_keyword("features", &mp_features_handler, &snprint_mp_features);
2659 install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
2660 install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
2661 install_keyword("gid", &mp_gid_handler, &snprint_mp_gid);
2662 install_keyword("reservation_key", &mp_reservation_key_handler, &snprint_mp_reservation_key);
2663 install_sublevel_end();