Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor-and-deprecation preview dumping ground #3845

Draft
wants to merge 186 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
3812b25
Refactor: libcrmcommon: New pcmk__xml_commit_changes()
nrwahl2 Mar 12, 2025
7d45b48
API: libcrmcommon: Deprecate xml_accept_changes()
nrwahl2 Mar 12, 2025
9893e2f
Refactor: libcrmcommon: Rename xml_private_flags to pcmk__xml_flags
nrwahl2 Mar 13, 2025
6959843
Refactor: libcrmcommon, tools: Drop redundant xml_track_changes() calls
nrwahl2 Mar 13, 2025
e022ecc
Refactor: libcib: Avoid cib_acl_enabled() duplication
nrwahl2 Mar 13, 2025
3533252
Refactor: libcrmcommon: Don't reuse doc in pcmk__xc_create() unit test
nrwahl2 Mar 13, 2025
86b23ce
Refactor: libcib, libcrmcommon: Drop xml_track_changes() internally
nrwahl2 Mar 12, 2025
24fc9a3
API: libcrmcommon: Deprecate xml_track_changes()
nrwahl2 Mar 13, 2025
bf8d589
Refactor: libcrmcommon: Don't set XML private flags without tracking
nrwahl2 Mar 13, 2025
e08c901
Doc: libcrmcommon: Document bug in xml_calculate_significant_changes()
nrwahl2 Mar 13, 2025
768d271
Refactor: libcrmcommon: Rename pcmk__xf_lazy to pcmk__xf_ignore_attr_pos
nrwahl2 Mar 13, 2025
61ad92b
Refactor: libcrmcommon: Make pcmk__xml_match() static
nrwahl2 Mar 15, 2025
bb566e7
Refactor: libcrmcommon: Drop redundant check from mark_child_deleted()
nrwahl2 Mar 15, 2025
76fd289
Refactor: libcrmcommon: Some best practices in mark_xml_changes()
nrwahl2 Mar 14, 2025
afb21dd
Refactor: libcrmcommon: Drop old_xml NULL case from mark_xml_changes()
nrwahl2 Mar 15, 2025
40f5828
Refactor: libcrmcommon: Best practices in pcmk__xc_match()
nrwahl2 Mar 16, 2025
63c58b1
Refactor: libcrmcommon: Functionize matching XML comment content
nrwahl2 Mar 16, 2025
5d7b74d
Low: libcrmcommon: Fix XML matching when marking changes
nrwahl2 Mar 15, 2025
37c27cf
Low: libcrmcommon: Always free temp node in mark_child_deleted()
nrwahl2 Mar 26, 2025
8e3457f
Refactor: libcrmcommon: Drop pcmk__xf_processed flag
nrwahl2 Mar 16, 2025
a2317a1
Refactor: libcrmcommon: Make pcmk__xc_match_child() static
nrwahl2 Mar 17, 2025
f71acf3
Refactor: libcrmcommon: New pcmk__xml_mark_changes()
nrwahl2 Mar 14, 2025
b235b11
API: libcrmcommon: Deprecate xml_calculate_changes()
nrwahl2 Mar 17, 2025
affe0d7
Refactor: libcrmcommon: Replace xml_calculate_significant_changes()
nrwahl2 Mar 17, 2025
8d315fb
API: libcrmcommon: Deprecate xml_calculate_significant_changes()
nrwahl2 Mar 17, 2025
d067e57
Refactor: libcrmcommon: Best practices in mark_child_moved()
nrwahl2 Mar 27, 2025
047d66e
Refactor: libcrmcommon: Document buggy return xml_patch_versions() RC
nrwahl2 Mar 17, 2025
37410f8
Refactor: libcrmcommon: New pcmk__xml_patchset_versions()
nrwahl2 Mar 17, 2025
d37ac3f
API: libcrmcommon: Deprecate xml_patch_versions()
nrwahl2 Mar 17, 2025
fcfbff2
Refactor: libcrmcommon: pcmk__digest_xml() argument is now const
nrwahl2 Mar 17, 2025
02a80f2
API: libcrmcommon: patchset_process_digest() const source/target args
nrwahl2 Mar 17, 2025
574c4d5
Refactor: libcrmcommon: pcmk__digest_on_disk_cib() argument is now const
nrwahl2 Mar 17, 2025
223b700
Refactor: libcrmcommon: pcmk__verify_digest() argument is now const
nrwahl2 Mar 17, 2025
03bf6b7
Refactor: libcrmcommon: pcmk__digest_operation() argument is now const
nrwahl2 Mar 17, 2025
e157ac1
Refactor: libcrmcommon: New pcmk__xml_patchset_add_digest()
nrwahl2 Mar 17, 2025
2e35743
API: libcrmcommon: Deprecate patchset_process_digest()
nrwahl2 Mar 17, 2025
cb63a43
Doc: libcrmcommon: Document need to maintain last two public XML funcs
nrwahl2 Mar 17, 2025
806cf9a
Refactor: libcrmcommon: Drop xml_acl_enabled() internally
nrwahl2 Mar 17, 2025
d912cb0
API: libcrmcommon: Deprecate xml_acl_enabled()
nrwahl2 Mar 17, 2025
8101669
Refactor: tools: Drop forward declarations in crm_diff.c
nrwahl2 Mar 17, 2025
3584d43
Doc: tools: Document input source precedence in crm_diff help output
nrwahl2 Mar 17, 2025
4429551
Refactor: tools: Overhaul input option storage in crm_diff.c
nrwahl2 Mar 17, 2025
2d27fe6
Refactor: tools: Use source/target consistently in crm_diff.c
nrwahl2 Mar 17, 2025
de7299e
Refactor: tools: Drop target_file arg of crm_diff.c:generate_patch()
nrwahl2 Mar 17, 2025
dee3d43
Refactor: various: Drop crm_copy_xml_element() internally
nrwahl2 Mar 17, 2025
f9336af
API: libcrmcommon: Deprecate crm_copy_xml_element()
nrwahl2 Mar 17, 2025
d1f7753
Refactor: tools: Best practices in crm_diff.c:generate_patch()
nrwahl2 Mar 17, 2025
f89da8d
Refactor: libcrmcommon: NULL-check XML private data in display functions
nrwahl2 Mar 17, 2025
d0c1a0e
API: libcrmcommon: xml_apply_patchset() patchset argument is now const
nrwahl2 Mar 17, 2025
5a99b20
Refactor: libcrmcommon: Make vfields file-scope in patchset.c
nrwahl2 Mar 17, 2025
371ebb3
Refactor: libcrmcommon: Some best practices in xml_patch_version_check()
nrwahl2 Mar 17, 2025
3669a8c
Refactor: libcrmcommon: Rename lpc to i in xml_patch_version_check()
nrwahl2 Mar 17, 2025
addc2ce
Refactor: libcrmcommon: Clarify check_patchset_versions()
nrwahl2 Mar 18, 2025
c27d531
Refactor: tools: Clean up crm_diff.c:apply_patchset()
nrwahl2 Mar 18, 2025
5aed4ab
Refactor: tools: Drop crm_diff.c:apply_patchset()
nrwahl2 Mar 18, 2025
cee87ab
Refactor: tools: Drop log_patchset_cib_versions()
nrwahl2 Mar 18, 2025
2bfd6e5
Doc: tools: Doxygen for crm_diff.c:print_patch()
nrwahl2 Mar 18, 2025
4e59c80
Refactor: tools: Clean up crm_diff.c includes
nrwahl2 Mar 18, 2025
2b0ddc8
Low: tools: Be stricter about crm_diff --cib/--no-version
nrwahl2 Mar 18, 2025
9eee50d
Log: tools: Improve error handling in crm_diff.c
nrwahl2 Mar 18, 2025
23eaae9
Refactor: tools: Add pcmk__output_t scaffolding to crm_diff.c
nrwahl2 Mar 18, 2025
2b3a10d
Refactor: tools: Use out->err() in crm_diff, and drop prompts
nrwahl2 Mar 18, 2025
ffa608f
Feature: tools: Deprecate crm_diff --stdin
nrwahl2 Mar 18, 2025
fca4ebc
Feature: tools: Use formatted output in crm_diff.c
nrwahl2 Mar 18, 2025
d84c2b2
Refactor: libcrmcluster: Check return value in parse_election_message()
nrwahl2 Mar 19, 2025
41f778f
Refactor: libcrmcommon: New pcmk__xe_get_timeval()
nrwahl2 Mar 19, 2025
8142171
API: libcrmcommon: Deprecate crm_element_value_timeval()
nrwahl2 Mar 19, 2025
e63a6de
Refactor: libcrmcommon: New pcmk__xe_get_time()
nrwahl2 Mar 19, 2025
30a31b2
Refactor: libpe_status: Fix whitespace issues in pe_actions.c
nrwahl2 Mar 19, 2025
9be9dfd
Refactor: various: Check pcmk__xe_get_time() rc only where useful
nrwahl2 Mar 19, 2025
51e3d57
API: libcrmcommon: Deprecate crm_element_value_epoch()
nrwahl2 Mar 19, 2025
cbbcee5
Refactor: libcrmcommon: New pcmk__xe_get_guint()
nrwahl2 Mar 19, 2025
a55fb7e
API: libcrmcommon: Deprecate crm_element_value_ms()
nrwahl2 Mar 19, 2025
82d2039
Refactor: various: Use pcmk__xe_get_time() where appropriate
nrwahl2 Mar 19, 2025
f55aef5
Refactor: libcrmcommon: New pcmk__xe_get_ll()
nrwahl2 Mar 19, 2025
832596d
API: libcrmcommon: Deprecate crm_element_value_ll()
nrwahl2 Mar 19, 2025
00f435c
Refactor: libcrmcomon: New pcmk__xe_get_int()
nrwahl2 Mar 19, 2025
8cb23d5
API: libcrmcommon: Deprecate crm_element_value_int()
nrwahl2 Mar 19, 2025
3b125be
Refactor: libcrmcommon: New pcmk__xe_get()
nrwahl2 Mar 19, 2025
e69997f
API: libcrmcommon: Deprecate crm_element_value()
nrwahl2 Mar 19, 2025
c939e90
Refactor: libcrmcommon: New pcmk__xe_get_copy()
nrwahl2 Mar 19, 2025
222ddbf
API: libcrmcommon: Deprecate crm_element_value_copy()
nrwahl2 Mar 19, 2025
772cb3d
Refactor: libcrmcommon: New pcmk__xe_set_timeval()
nrwahl2 Mar 19, 2025
db4a333
API: libcrmcommon: Deprecate crm_xml_add_timeval()
nrwahl2 Mar 19, 2025
e8841ab
Refactor: libcrmcommon: New pcmk__xe_set_time()
nrwahl2 Mar 19, 2025
1399df9
Refactor: libcrmcommon: New pcmk__xe_set_guint()
nrwahl2 Mar 19, 2025
ce05f1d
API: libcrmcommon: Deprecate crm_xml_add_ms()
nrwahl2 Mar 19, 2025
a7d52a7
Refactor: libcrmcommon: New pcmk__xe_set_ll()
nrwahl2 Mar 19, 2025
783c8c9
API: libcrmcommon: Deprecate crm_xml_add_ll()
nrwahl2 Mar 19, 2025
4084c97
Refactor: libcrmcommon: New pcmk__xe_set_int()
nrwahl2 Mar 19, 2025
df84f93
API: libcrmcommon: Deprecate crm_xml_add_int()
nrwahl2 Mar 19, 2025
9fecbc2
Refactor: libcrmcommon: New pcmk__xe_set()
nrwahl2 Mar 20, 2025
3f5bb52
API: libcrmcommon: Deprecate crm_xml_add()
nrwahl2 Mar 20, 2025
8361d13
Refactor: libcrmcommon: New pcmk__xml_write_temp_file()
nrwahl2 Mar 21, 2025
a8f5ffc
API: libcrmcommon: Deprecate save_xml_to_file()
nrwahl2 Mar 21, 2025
c2a9fa9
Refactor: libcrmcommon: New PCMK__BZ2_ string constants
nrwahl2 Mar 21, 2025
d1dd9cb
API: libcrmcommon: Deprecate CRM_BZ2_BLOCKS
nrwahl2 Mar 21, 2025
5e812c4
API: libcrmcommon: Deprecate CRM_BZ2_WORK
nrwahl2 Mar 21, 2025
81f6f1b
API: libcrmcommon: Deprecate CRM_BZ2_THRESHOLD
nrwahl2 Mar 21, 2025
905b295
Refactor: controller: Clean up controld_verify_stonith_watchdog_timeout
nrwahl2 Mar 21, 2025
e823f48
Low: controller, fencer: Ignore negative/unparsable pcmk_monitor_timeout
nrwahl2 Mar 21, 2025
fcff6eb
Refactor: libcrmcommon: Improve pcmk__get_sbd_watchdog_timeout() rc
nrwahl2 Mar 21, 2025
cacff63
Low: libcrmcommon: Ensure stonith watchdog timeout is in long range
nrwahl2 Mar 21, 2025
caeb028
Low: libcrmcommon: Fix integer overflow of alert timeouts
nrwahl2 Mar 21, 2025
6ec7850
Low: fencer: Prevent unsigned int overflow in get_action_timeout()
nrwahl2 Mar 21, 2025
31fb20c
Refactor: tools: Use unsigned int for tolerance in stonith_admin.c
nrwahl2 Mar 21, 2025
4fc6791
Test: libcrmcommon: Trigger overflow properly for crm_get_msec()
nrwahl2 Mar 21, 2025
fac495f
Refactor: libcrmcommon: New pcmk__parse_ms()
nrwahl2 Mar 21, 2025
129d1b8
API: libcrmcommon: Deprecate crm_get_msec()
nrwahl2 Mar 21, 2025
6728a2f
Refactor: libcrmcommon: Allow negative values in pcmk__parse_ms()
nrwahl2 Mar 21, 2025
3f430fb
Refactor: libcrmcommon: Don't skip initial whitespace in pcmk__parse_ms
nrwahl2 Mar 23, 2025
08beba4
Refactor: libcrmcommon: Functionize parsing units in pcmk__parse_ms()
nrwahl2 Mar 23, 2025
f1f918d
Refactor: libcrmcommon: New pcmk__parse_bool()
nrwahl2 Mar 23, 2025
3051eb2
Test: libcrmcommon: Test pcmk__parse_bool() more thoroughly
nrwahl2 Mar 23, 2025
05469b5
Refactor: libcrmcommon: New pcmk__is_true() function
nrwahl2 Mar 23, 2025
67359c5
API: libcrmcommon: Deprecate crm_is_true()
nrwahl2 Mar 23, 2025
27af7c4
API: libcrmcommon: Deprecate crm_str_to_boolean()
nrwahl2 Mar 23, 2025
2c3dbca
Refactor: libcrmcommon: New pcmk__assert_asprintf()
nrwahl2 Mar 23, 2025
a5651aa
API: libcrmcommon: Deprecate crm_strdup_printf()
nrwahl2 Mar 23, 2025
1f54b2c
Refactor: libcrmcommon: New pcmk__is_set()
nrwahl2 Mar 23, 2025
832d6c7
API: libcrmcommon: Deprecate pcmk_is_set()
nrwahl2 Mar 23, 2025
448d28b
Refactor: libcrmcommon: New pcmk__all_flags_set()
nrwahl2 Mar 23, 2025
6f78fc3
API: libcrmcommon: Deprecate pcmk_all_flags_set()
nrwahl2 Mar 23, 2025
419f1cc
Refactor: libcrmcommon: New pcmk__any_flags_set()
nrwahl2 Mar 23, 2025
c7c87af
API: libcrmcommon: Deprecate pcmk_any_flags_set()
nrwahl2 Mar 23, 2025
15d5878
Refactor: libcrmcommon: New pcmk__md5sum()
nrwahl2 Mar 23, 2025
b669c5c
API: libcrmcommon: Deprecate crm_md5sum()
nrwahl2 Mar 23, 2025
224e2cb
Refactor: libcrmcommon: New pcmk__generate_uuid()
nrwahl2 Mar 24, 2025
d892713
API: libcrmcommon: Deprecate crm_generate_uuid()
nrwahl2 Mar 24, 2025
f94051f
Refactor: pacemakerd: Fix indentation in pcmk_subdaemons.c:start_child()
nrwahl2 Mar 24, 2025
e153f1d
Refactor: pacemakerd: Remove nesting in start_child()
nrwahl2 Mar 24, 2025
d53a4a3
Refactor: pacemakerd: Use as_root boolean in pcmk_child_t
nrwahl2 Mar 24, 2025
ed09ef6
Refactor: pacemakerd: Rename pcmk_child_t to pcmkd_child_t
nrwahl2 Mar 24, 2025
d1357bf
Refactor: pacemakerd: Remove some nesting in child_liveness()
nrwahl2 Mar 24, 2025
e5d1fd1
Refactor: pacemakerd: Remove more nesting from child_liveness()
nrwahl2 Mar 24, 2025
7d1ff79
Refactor: pacemakerd: Remove still more nesting from child_liveness()
nrwahl2 Mar 24, 2025
9dbaaad
Refactor: libcrmcommon: New pcmk__daemon_user()
nrwahl2 Mar 24, 2025
97d7e46
API: libcrmcommon: Deprecate pcmk_daemon_user()
nrwahl2 Mar 24, 2025
e47b019
API: libcrmservice: Change services_action_user() not-found return code
nrwahl2 Mar 24, 2025
8aeefb9
API: libcrmcommon: Deprecate crm_user_lookup()
nrwahl2 Mar 24, 2025
68a3f0f
Refactor: libcrmcommon: Drop PCMK__PW_BUFFER_LEN
nrwahl2 Mar 24, 2025
9bdac73
Test: libcrmcommon: More compare_version() unit tests
nrwahl2 Mar 24, 2025
c2b5523
Refactor: libcrmcommon: New pcmk__compare_versions()
nrwahl2 Mar 24, 2025
44d161e
Refactor: libcrmcommon: Use regex for pcmk__compare_versions()
nrwahl2 Mar 25, 2025
41c12a7
API: libcrmcommon: Deprecate compare_version()
nrwahl2 Mar 24, 2025
52724e5
Refactor: libcrmcommon: Use pcmk__compare_versions() for transforms
nrwahl2 Mar 25, 2025
4994afd
Refactor: libcrmcommon: Remove unused includes from util.h
nrwahl2 Mar 25, 2025
b677105
Refactor: libcrmcommon: Drop unused include from schemas.h
nrwahl2 Mar 25, 2025
baa59c8
Refactor: libcrmcommon: Remove a few more unused includes from headers
nrwahl2 Mar 25, 2025
aea5aa0
Refactor: libcrmcommon: Replace qb_logt() with qb_log()
nrwahl2 Mar 27, 2025
5689b1e
Refactor: libcrmcommon, executor: Drop space before variadic arg comma
nrwahl2 Mar 27, 2025
777e97a
Refactor: libcrmcommon: New pcmk__emerg()
nrwahl2 Mar 27, 2025
a08dd29
API: libcrmcommon: Deprecate crm_emerg()
nrwahl2 Mar 27, 2025
d31b16a
Refactor: libcrmcommon: New pcmk__crit()
nrwahl2 Mar 27, 2025
cfd307d
API: libcrmcommon: Deprecate crm_crit()
nrwahl2 Mar 27, 2025
c446a74
Refactor: libcrmcommon: New pcmk__err()
nrwahl2 Mar 27, 2025
eb02cb6
API: libcrmcommon: Deprecate crm_err()
nrwahl2 Mar 27, 2025
60d99bf
Refactor: libcrmcommon: New pcmk__warn()
nrwahl2 Mar 27, 2025
d86c080
API: libcrmcommon: Deprecate crm_warn()
nrwahl2 Mar 27, 2025
cc2f6bb
Refactor: libcrmcommon: New pcmk__notice()
nrwahl2 Mar 27, 2025
c06f701
API: libcrmcommon: Deprecate crm_notice()
nrwahl2 Mar 27, 2025
2db0338
Refactor: libcrmcommon: New pcmk__info()
nrwahl2 Mar 27, 2025
9861f75
API: libcrmcommon: Deprecate crm_info()
nrwahl2 Mar 27, 2025
2f2d0d6
Refactor: various: Include internal headers in crm_internal.h
nrwahl2 Mar 28, 2025
f07aa3b
Refactor: libcrmcommon: Drop unused includes from internal.h
nrwahl2 Mar 28, 2025
c501142
Refactor: libcrmcommon: New pcmk__debug()
nrwahl2 Mar 27, 2025
0aa86b8
API: libcrmcommon: Deprecate crm_debug()
nrwahl2 Mar 27, 2025
21b0ec4
Refactor: libcrmcommon: New PCMK__LOG_STDOUT
nrwahl2 Mar 27, 2025
d9349a7
Refactor: libcrmcommon: New PCMK__LOG_NEVER
nrwahl2 Mar 27, 2025
71f4405
Doc: libcrmcommon: Add caveat to mark_child_deleted() doxygen
nrwahl2 Mar 27, 2025
c4e2d88
Refactor: libcrmcommon: New PCMK__LOG_TRACE
nrwahl2 Mar 27, 2025
01b5a5e
Refactor: libcrmcommon: New pcmk__trace()
nrwahl2 Mar 28, 2025
a303709
API: libcrmcommon: Deprecate crm_trace()
nrwahl2 Mar 28, 2025
f026af7
API: libcrmcommon: Deprecate crm_log_xml_crit()
nrwahl2 Mar 28, 2025
0ed695c
Refactor: libcrmcommon: New pcmk__log_xml_err()
nrwahl2 Mar 28, 2025
1c6e786
API: libcrmcommon: Deprecate crm_log_xml_err()
nrwahl2 Mar 28, 2025
7b9b087
Refactor: libcrmcommon: New pcmk__log_xml_warn()
nrwahl2 Mar 28, 2025
8fd5529
API: libcrmcommon: Deprecate crm_log_xml_warn()
nrwahl2 Mar 28, 2025
b7e3653
Refactor: libcrmcommon: New pcmk__log_xml_notice()
nrwahl2 Mar 28, 2025
11c591d
API: libcrmcommon: Deprecate crm_log_xml_notice()
nrwahl2 Mar 28, 2025
3278bb0
Refactor: libcrmcommon: New pcmk__log_xml_info()
nrwahl2 Mar 28, 2025
719e7d2
API: libcrmcommon: Deprecate crm_log_xml_info()
nrwahl2 Mar 28, 2025
c2be820
Refactor: libcrmcommon: New pcmk__log_xml_debug()
nrwahl2 Mar 28, 2025
78b0665
API: libcrmcommon: Deprecate crm_log_xml_debug()
nrwahl2 Mar 28, 2025
25863ce
Refactor: libcrmcommon: New pcmk__log_xml_trace()
nrwahl2 Mar 28, 2025
966f5f6
API: libcrmcommon: Deprecate crm_log_xml_trace()
nrwahl2 Mar 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions daemons/attrd/attrd_alerts.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2024 the Pacemaker project contributors
* Copyright 2015-2025 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand All @@ -26,7 +26,7 @@ attrd_lrmd_callback(lrmd_event_data_t * op)
CRM_CHECK(op != NULL, return);
switch (op->type) {
case lrmd_event_disconnect:
crm_info("Lost connection to executor");
pcmk__info("Lost connection to executor");
attrd_lrmd_disconnect();
break;
default:
Expand All @@ -52,8 +52,8 @@ attrd_lrmd_connect(void)
break;
}

crm_debug("Could not connect to executor, %d tries remaining",
(max_attempts - fails));
pcmk__debug("Could not connect to executor, %d tries remaining",
(max_attempts - fails));
/* @TODO We don't want to block here with sleep, but we should wait
* some time between connection attempts. We could possibly add a
* timer with a callback, but then we'd likely need an alert queue.
Expand Down Expand Up @@ -84,10 +84,10 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
xmlNode *crmalerts = NULL;

if (rc == -ENXIO) {
crm_debug("Local CIB has no alerts section");
pcmk__debug("Local CIB has no alerts section");
return;
} else if (rc != pcmk_ok) {
crm_notice("Could not query local CIB: %s", pcmk_strerror(rc));
pcmk__notice("Could not query local CIB: %s", pcmk_strerror(rc));
return;
}

Expand All @@ -96,7 +96,7 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
crmalerts = pcmk__xe_first_child(crmalerts, PCMK_XE_ALERTS, NULL, NULL);
}
if (!crmalerts) {
crm_notice("CIB query result has no " PCMK_XE_ALERTS " section");
pcmk__notice("CIB query result has no " PCMK_XE_ALERTS " section");
return;
}

Expand All @@ -119,7 +119,7 @@ attrd_read_options(gpointer user_data)
"config_query_callback",
config_query_callback, free);

crm_trace("Querying the CIB... call %d", call_id);
pcmk__trace("Querying the CIB... call %d", call_id);
return TRUE;
}

Expand Down
102 changes: 51 additions & 51 deletions daemons/attrd/attrd_attributes.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2024 the Pacemaker project contributors
* Copyright 2013-2025 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand All @@ -26,9 +26,9 @@ attrd_create_attribute(xmlNode *xml)
{
int is_private = 0;
long long dampen = 0;
const char *name = crm_element_value(xml, PCMK__XA_ATTR_NAME);
const char *set_type = crm_element_value(xml, PCMK__XA_ATTR_SET_TYPE);
const char *dampen_s = crm_element_value(xml, PCMK__XA_ATTR_DAMPENING);
const char *name = pcmk__xe_get(xml, PCMK__XA_ATTR_NAME);
const char *set_type = pcmk__xe_get(xml, PCMK__XA_ATTR_SET_TYPE);
const char *dampen_s = pcmk__xe_get(xml, PCMK__XA_ATTR_DAMPENING);
attribute_t *a = NULL;

if (set_type == NULL) {
Expand All @@ -38,42 +38,42 @@ attrd_create_attribute(xmlNode *xml)
/* Set type is meaningful only when writing to the CIB. Private
* attributes are not written.
*/
crm_element_value_int(xml, PCMK__XA_ATTR_IS_PRIVATE, &is_private);
pcmk__xe_get_int(xml, PCMK__XA_ATTR_IS_PRIVATE, &is_private);
if (!is_private && !pcmk__str_any_of(set_type,
PCMK_XE_INSTANCE_ATTRIBUTES,
PCMK_XE_UTILIZATION, NULL)) {
crm_warn("Ignoring attribute %s with invalid set type %s",
pcmk__s(name, "(unidentified)"), set_type);
pcmk__warn("Ignoring attribute %s with invalid set type %s",
pcmk__s(name, "(unidentified)"), set_type);
return NULL;
}

a = pcmk__assert_alloc(1, sizeof(attribute_t));

a->id = pcmk__str_copy(name);
a->set_type = pcmk__str_copy(set_type);
a->set_id = crm_element_value_copy(xml, PCMK__XA_ATTR_SET);
a->user = crm_element_value_copy(xml, PCMK__XA_ATTR_USER);
a->set_id = pcmk__xe_get_copy(xml, PCMK__XA_ATTR_SET);
a->user = pcmk__xe_get_copy(xml, PCMK__XA_ATTR_USER);
a->values = pcmk__strikey_table(NULL, attrd_free_attribute_value);

if (is_private) {
attrd_set_attr_flags(a, attrd_attr_is_private);
}

if (dampen_s != NULL) {
dampen = crm_get_msec(dampen_s);
}
if ((pcmk__parse_ms(dampen_s, &dampen) != pcmk_rc_ok) || (dampen < 0)) {
pcmk__warn("Ignoring invalid delay %s for attribute %s", dampen_s,
a->id);

if (dampen > 0) {
a->timeout_ms = (int) QB_MIN(dampen, INT_MAX);
a->timer = attrd_add_timer(a->id, a->timeout_ms, a);
} else if (dampen < 0) {
crm_warn("Ignoring invalid delay %s for attribute %s", dampen_s, a->id);
} else if (dampen > 0) {
a->timeout_ms = (int) QB_MIN(dampen, INT_MAX);
a->timer = attrd_add_timer(a->id, a->timeout_ms, a);
}
}

crm_trace("Created attribute %s with %s write delay and %s CIB user",
a->id,
((dampen > 0)? pcmk__readable_interval(a->timeout_ms) : "no"),
pcmk__s(a->user, "default"));
pcmk__trace("Created attribute %s with %s write delay and %s CIB user",
a->id,
((dampen > 0)? pcmk__readable_interval(a->timeout_ms) : "no"),
pcmk__s(a->user, "default"));

g_hash_table_replace(attributes, a->id, a);
return a;
Expand All @@ -82,19 +82,18 @@ attrd_create_attribute(xmlNode *xml)
static int
attrd_update_dampening(attribute_t *a, xmlNode *xml, const char *attr)
{
const char *dvalue = crm_element_value(xml, PCMK__XA_ATTR_DAMPENING);
const char *dvalue = pcmk__xe_get(xml, PCMK__XA_ATTR_DAMPENING);
long long dampen = 0;

if (dvalue == NULL) {
crm_warn("Could not update %s: peer did not specify value for delay",
attr);
pcmk__warn("Could not update %s: peer did not specify value for delay",
attr);
return EINVAL;
}

dampen = crm_get_msec(dvalue);
if (dampen < 0) {
crm_warn("Could not update %s: invalid delay value %dms (%s)",
attr, dampen, dvalue);
if ((pcmk__parse_ms(dvalue, &dampen) != pcmk_rc_ok) || (dampen < 0)) {
pcmk__warn("Could not update %s: invalid delay value %dms (%s)", attr,
dampen, dvalue);
return EINVAL;
}

Expand All @@ -103,11 +102,11 @@ attrd_update_dampening(attribute_t *a, xmlNode *xml, const char *attr)
a->timeout_ms = (int) QB_MIN(dampen, INT_MAX);
if (dampen > 0) {
a->timer = attrd_add_timer(attr, a->timeout_ms, a);
crm_info("Update attribute %s delay to %dms (%s)",
attr, dampen, dvalue);
pcmk__info("Update attribute %s delay to %dms (%s)",
attr, dampen, dvalue);
} else {
a->timer = NULL;
crm_info("Update attribute %s to remove delay", attr);
pcmk__info("Update attribute %s to remove delay", attr);
}

/* If dampening changed, do an immediate write-out,
Expand Down Expand Up @@ -138,28 +137,29 @@ attrd_add_value_xml(xmlNode *parent, const attribute_t *a,
{
xmlNode *xml = pcmk__xe_create(parent, __func__);

crm_xml_add(xml, PCMK__XA_ATTR_NAME, a->id);
crm_xml_add(xml, PCMK__XA_ATTR_SET_TYPE, a->set_type);
crm_xml_add(xml, PCMK__XA_ATTR_SET, a->set_id);
crm_xml_add(xml, PCMK__XA_ATTR_USER, a->user);
crm_xml_add(xml, PCMK__XA_ATTR_HOST, v->nodename);
pcmk__xe_set(xml, PCMK__XA_ATTR_NAME, a->id);
pcmk__xe_set(xml, PCMK__XA_ATTR_SET_TYPE, a->set_type);
pcmk__xe_set(xml, PCMK__XA_ATTR_SET, a->set_id);
pcmk__xe_set(xml, PCMK__XA_ATTR_USER, a->user);
pcmk__xe_set(xml, PCMK__XA_ATTR_HOST, v->nodename);

/* @COMPAT Prior to 2.1.10 and 3.0.1, the node's cluster ID was added
* instead of its XML ID. For Corosync and Pacemaker Remote nodes, those are
* the same, but if we ever support node XML IDs that differ from their
* cluster IDs, we will have to drop support for rolling upgrades from
* versions before those.
*/
crm_xml_add(xml, PCMK__XA_ATTR_HOST_ID, attrd_get_node_xml_id(v->nodename));

crm_xml_add(xml, PCMK__XA_ATTR_VALUE, v->current);
crm_xml_add_int(xml, PCMK__XA_ATTR_DAMPENING,
pcmk__timeout_ms2s(a->timeout_ms));
crm_xml_add_int(xml, PCMK__XA_ATTR_IS_PRIVATE,
pcmk_is_set(a->flags, attrd_attr_is_private));
crm_xml_add_int(xml, PCMK__XA_ATTR_IS_REMOTE,
pcmk_is_set(v->flags, attrd_value_remote));
crm_xml_add_int(xml, PCMK__XA_ATTRD_IS_FORCE_WRITE, force_write);
pcmk__xe_set(xml, PCMK__XA_ATTR_HOST_ID,
attrd_get_node_xml_id(v->nodename));

pcmk__xe_set(xml, PCMK__XA_ATTR_VALUE, v->current);
pcmk__xe_set_int(xml, PCMK__XA_ATTR_DAMPENING,
pcmk__timeout_ms2s(a->timeout_ms));
pcmk__xe_set_int(xml, PCMK__XA_ATTR_IS_PRIVATE,
pcmk__is_set(a->flags, attrd_attr_is_private));
pcmk__xe_set_int(xml, PCMK__XA_ATTR_IS_REMOTE,
pcmk__is_set(v->flags, attrd_value_remote));
pcmk__xe_set_int(xml, PCMK__XA_ATTRD_IS_FORCE_WRITE, force_write);

return xml;
}
Expand Down Expand Up @@ -187,7 +187,7 @@ attrd_populate_attribute(xmlNode *xml, const char *attr)
attribute_t *a = NULL;
bool update_both = false;

const char *op = crm_element_value(xml, PCMK_XA_TASK);
const char *op = pcmk__xe_get(xml, PCMK_XA_TASK);

// NULL because PCMK__ATTRD_CMD_SYNC_RESPONSE has no PCMK_XA_TASK
update_both = pcmk__str_eq(op, PCMK__ATTRD_CMD_UPDATE_BOTH,
Expand All @@ -203,7 +203,7 @@ attrd_populate_attribute(xmlNode *xml, const char *attr)
}

} else {
crm_warn("Could not update %s: attribute not found", attr);
pcmk__warn("Could not update %s: attribute not found", attr);
return NULL;
}
}
Expand Down Expand Up @@ -243,7 +243,7 @@ attrd_set_id(const attribute_t *attr, const char *node_state_id)
* not limited by the schema in any way, but it's still unfortunate.
* For backward compatibility reasons, we can't change this.
*/
set_id = crm_strdup_printf("%s-%s", PCMK_XE_STATUS, node_state_id);
set_id = pcmk__assert_asprintf("%s-%s", PCMK_XE_STATUS, node_state_id);
} else {
/* @COMPAT When the user specifies a set ID for an attribute, it is the
* same for every node. That is less than ideal, but again, the schema
Expand Down Expand Up @@ -273,11 +273,11 @@ attrd_nvpair_id(const attribute_t *attr, const char *node_state_id)
char *nvpair_id = NULL;

if (attr->set_id != NULL) {
nvpair_id = crm_strdup_printf("%s-%s", attr->set_id, attr->id);
nvpair_id = pcmk__assert_asprintf("%s-%s", attr->set_id, attr->id);

} else {
nvpair_id = crm_strdup_printf(PCMK_XE_STATUS "-%s-%s",
node_state_id, attr->id);
nvpair_id = pcmk__assert_asprintf(PCMK_XE_STATUS "-%s-%s",
node_state_id, attr->id);
}
pcmk__xml_sanitize_id(nvpair_id);
return nvpair_id;
Expand Down
Loading