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

Function cib_process_delete_absolute

cib/messages.c:361–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361int
362cib_process_delete_absolute(const char *op, int options, const char *section, xmlNode * req,
363 xmlNode * input, xmlNode * existing_cib, xmlNode ** result_cib,
364 xmlNode ** answer)
365{
366 xmlNode *failed = NULL;
367 int result = pcmk_ok;
368 xmlNode *update_section = NULL;
369
370 crm_trace("Processing \"%s\" event for section=%s", op, crm_str(section));
371 if (safe_str_eq(XML_CIB_TAG_SECTION_ALL, section)) {
372 section = NULL;
373
374 } else if (safe_str_eq(XML_TAG_CIB, section)) {
375 section = NULL;
376
377 } else if (safe_str_eq(crm_element_name(input), XML_TAG_CIB)) {
378 section = NULL;
379 }
380
381 CRM_CHECK(strcasecmp(CIB_OP_DELETE, op) == 0, return -EINVAL);
382
383 if (input == NULL) {
384 crm_err("Cannot perform modification with no data");
385 return -EINVAL;
386 }
387
388 failed = create_xml_node(NULL, XML_TAG_FAILED);
389
390 update_section = get_object_root(section, *result_cib);
391 result = delete_cib_object(update_section, input);
392 update_results(failed, input, op, result);
393
394 if (xml_has_children(failed)) {
395 CRM_CHECK(result != pcmk_ok, result = -EINVAL);
396 }
397
398 if (result != pcmk_ok) {
399 crm_log_xml_err(failed, "CIB Update failures");
400 *answer = failed;
401
402 } else {
403 free_xml(failed);
404 }
405
406 return result;
407}
408
409gboolean
410check_generation(xmlNode * newCib, xmlNode * oldCib)

Callers

nothing calls this directly

Calls 6

create_xml_nodeFunction · 0.85
get_object_rootFunction · 0.85
delete_cib_objectFunction · 0.85
update_resultsFunction · 0.85
xml_has_childrenFunction · 0.85
free_xmlFunction · 0.85

Tested by

no test coverage detected