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

Function update_xml_child

lib/common/xml.c:1686–1717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686gboolean
1687update_xml_child(xmlNode *child, xmlNode *to_update)
1688{
1689 gboolean can_update = TRUE;
1690 xmlNode *child_of_child = NULL;
1691
1692 CRM_CHECK(child != NULL, return FALSE);
1693 CRM_CHECK(to_update != NULL, return FALSE);
1694
1695 if(safe_str_neq(crm_element_name(to_update), crm_element_name(child))) {
1696 can_update = FALSE;
1697
1698 } else if(safe_str_neq(ID(to_update), ID(child))) {
1699 can_update = FALSE;
1700
1701 } else if(can_update) {
1702#if XML_PARSER_DEBUG
1703 crm_log_xml_trace(child, "Update match found...");
1704#endif
1705 add_xml_object(NULL, child, to_update, FALSE);
1706 }
1707
1708 for(child_of_child = __xml_first_child(child); child_of_child != NULL; child_of_child = __xml_next(child_of_child)) {
1709 /* only update the first one */
1710 if(can_update) {
1711 break;
1712 }
1713 can_update = update_xml_child(child_of_child, to_update);
1714 }
1715
1716 return can_update;
1717}
1718
1719
1720int

Callers 2

cib_process_modifyFunction · 0.85
cib_process_xpathFunction · 0.85

Calls 4

safe_str_neqFunction · 0.85
add_xml_objectFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85

Tested by

no test coverage detected