| 760 | } |
| 761 | |
| 762 | int |
| 763 | cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output, int level) |
| 764 | { |
| 765 | int rc = pcmk_err_generic; |
| 766 | |
| 767 | xmlNode *diff = NULL; |
| 768 | |
| 769 | CRM_ASSERT(event); |
| 770 | CRM_ASSERT(input); |
| 771 | CRM_ASSERT(output); |
| 772 | |
| 773 | crm_element_value_int(event, F_CIB_RC, &rc); |
| 774 | diff = get_message_xml(event, F_CIB_UPDATE_RESULT); |
| 775 | |
| 776 | if (rc < pcmk_ok || diff == NULL) { |
| 777 | return rc; |
| 778 | } |
| 779 | |
| 780 | if (level > LOG_CRIT) { |
| 781 | log_cib_diff(level, diff, "Config update"); |
| 782 | } |
| 783 | |
| 784 | if (input != NULL) { |
| 785 | rc = cib_process_diff(NULL, cib_none, NULL, NULL, diff, input, output, NULL); |
| 786 | |
| 787 | if (rc != pcmk_ok) { |
| 788 | crm_debug("Update didn't apply: %s", pcmk_strerror(rc)); |
| 789 | return rc; |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | return rc; |
| 794 | } |
| 795 | |
| 796 | gboolean |
| 797 | cib_internal_config_changed(xmlNode * diff) |
no test coverage detected