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

Function create_op

tools/crm_simulate.c:274–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274static lrmd_event_data_t *
275create_op(xmlNode * cib_resource, const char *task, int interval, int outcome)
276{
277 lrmd_event_data_t *op = NULL;
278 xmlNode *xop = NULL;
279
280 op = calloc(1, sizeof(lrmd_event_data_t));
281
282 op->rsc_id = strdup(ID(cib_resource));
283 op->interval = interval;
284 op->op_type = strdup(task);
285
286 op->rc = outcome;
287 op->op_status = 0;
288 op->params = NULL; /* TODO: Fill me in */
289
290 op->call_id = 0;
291 for (xop = __xml_first_child(cib_resource); xop != NULL; xop = __xml_next(xop)) {
292 int tmp = 0;
293
294 crm_element_value_int(xop, XML_LRM_ATTR_CALLID, &tmp);
295 if (tmp > op->call_id) {
296 op->call_id = tmp;
297 }
298 }
299 op->call_id++;
300
301 return op;
302}
303
304static xmlNode *
305inject_op(xmlNode * cib_resource, lrmd_event_data_t * op, int target_rc)

Callers 1

modify_configurationFunction · 0.85

Calls 3

__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_element_value_intFunction · 0.85

Tested by

no test coverage detected