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

Function CancelXmlOp

pengine/allocate.c:139–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139static void
140CancelXmlOp(resource_t * rsc, xmlNode * xml_op, node_t * active_node,
141 const char *reason, pe_working_set_t * data_set)
142{
143 int interval = 0;
144 action_t *cancel = NULL;
145
146 char *key = NULL;
147 const char *task = NULL;
148 const char *call_id = NULL;
149 const char *interval_s = NULL;
150
151 CRM_CHECK(xml_op != NULL, return);
152 CRM_CHECK(active_node != NULL, return);
153
154 task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
155 call_id = crm_element_value(xml_op, XML_LRM_ATTR_CALLID);
156 interval_s = crm_element_value(xml_op, XML_LRM_ATTR_INTERVAL);
157
158 interval = crm_parse_int(interval_s, "0");
159
160 /* we need to reconstruct the key because of the way we used to construct resource IDs */
161 key = generate_op_key(rsc->id, task, interval);
162
163 crm_info("Action %s on %s will be stopped: %s",
164 key, active_node->details->uname, reason ? reason : "unknown");
165
166 cancel = custom_action(rsc, strdup(key), RSC_CANCEL, active_node, FALSE, TRUE, data_set);
167
168 free(cancel->task);
169 cancel->task = strdup(RSC_CANCEL);
170
171 add_hash_param(cancel->meta, XML_LRM_ATTR_TASK, task);
172 add_hash_param(cancel->meta, XML_LRM_ATTR_CALLID, call_id);
173 add_hash_param(cancel->meta, XML_LRM_ATTR_INTERVAL, interval_s);
174
175 custom_action_order(rsc, stop_key(rsc), NULL, rsc, NULL, cancel, pe_order_optional, data_set);
176 free(key);
177 key = NULL;
178}
179
180static gboolean
181check_action_definition(resource_t * rsc, node_t * active_node, xmlNode * xml_op,

Callers 2

check_action_definitionFunction · 0.85
check_actions_forFunction · 0.85

Calls 6

crm_element_valueFunction · 0.85
crm_parse_intFunction · 0.85
generate_op_keyFunction · 0.85
custom_actionFunction · 0.85
add_hash_paramFunction · 0.85
custom_action_orderFunction · 0.85

Tested by

no test coverage detected