MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / unpack_config

Function unpack_config

lib/pengine/unpack.c:62–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62gboolean
63unpack_config(xmlNode * config, pe_working_set_t * data_set)
64{
65 const char *value = NULL;
66 GHashTable *config_hash =
67 g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str);
68
69 data_set->config_hash = config_hash;
70
71 unpack_instance_attributes(data_set->input, config, XML_CIB_TAG_PROPSET, NULL, config_hash,
72 CIB_OPTIONS_FIRST, FALSE, data_set->now);
73
74 verify_pe_options(data_set->config_hash);
75
76 set_config_flag(data_set, "enable-startup-probes", pe_flag_startup_probes);
77 crm_info("Startup probes: %s",
78 is_set(data_set->flags, pe_flag_startup_probes) ? "enabled" : "disabled (dangerous)");
79
80 value = pe_pref(data_set->config_hash, "stonith-timeout");
81 data_set->stonith_timeout = crm_get_msec(value);
82 crm_debug("STONITH timeout: %d", data_set->stonith_timeout);
83
84 set_config_flag(data_set, "stonith-enabled", pe_flag_stonith_enabled);
85 crm_debug("STONITH of failed nodes is %s",
86 is_set(data_set->flags, pe_flag_stonith_enabled) ? "enabled" : "disabled");
87
88 data_set->stonith_action = pe_pref(data_set->config_hash, "stonith-action");
89 crm_trace("STONITH will %s nodes", data_set->stonith_action);
90
91 set_config_flag(data_set, "stop-all-resources", pe_flag_stop_everything);
92 crm_debug("Stop all active resources: %s",
93 is_set(data_set->flags, pe_flag_stop_everything) ? "true" : "false");
94
95 set_config_flag(data_set, "symmetric-cluster", pe_flag_symmetric_cluster);
96 if (is_set(data_set->flags, pe_flag_symmetric_cluster)) {
97 crm_debug("Cluster is symmetric" " - resources can run anywhere by default");
98 }
99
100 value = pe_pref(data_set->config_hash, "default-resource-stickiness");
101 data_set->default_resource_stickiness = char2score(value);
102 crm_debug("Default stickiness: %d", data_set->default_resource_stickiness);
103
104 value = pe_pref(data_set->config_hash, "no-quorum-policy");
105
106 if (safe_str_eq(value, "ignore")) {
107 data_set->no_quorum_policy = no_quorum_ignore;
108
109 } else if (safe_str_eq(value, "freeze")) {
110 data_set->no_quorum_policy = no_quorum_freeze;
111
112 } else if (safe_str_eq(value, "suicide")) {
113 gboolean do_panic = FALSE;
114
115 crm_element_value_int(data_set->input, XML_ATTR_QUORUM_PANIC, &do_panic);
116
117 if (is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE) {
118 crm_config_err
119 ("Setting no-quorum-policy=suicide makes no sense if stonith-enabled=false");

Callers 1

cluster_statusFunction · 0.85

Calls 7

verify_pe_optionsFunction · 0.85
is_setFunction · 0.85
pe_prefFunction · 0.85
crm_get_msecFunction · 0.85
char2scoreFunction · 0.85
crm_element_value_intFunction · 0.85

Tested by

no test coverage detected