Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
093af10
API: libcrmcommon: Deprecate crm_time_calculate_duration()
nrwahl2 Apr 30, 2026
3eef361
Refactor: libcrmcommon: New pcmk__time_parse_duration()
nrwahl2 Apr 30, 2026
a940662
API: libcrmcommon: Deprecate crm_time_parse_duration()
nrwahl2 Apr 30, 2026
ba64961
Refactor: libcrmcommon: Clean up includes in scheduler.h
nrwahl2 May 1, 2026
5c1014e
Refactor: various: Drop crm_time_new_undefined() internally
nrwahl2 May 1, 2026
142b386
API: libcrmcommon: Deprecate crm_time_new_undefined()
nrwahl2 May 1, 2026
9177048
Refactor: libcrmcommon: New pcmk__time_is_initialized()
nrwahl2 May 1, 2026
925909a
API: libcrmcommon: Deprecate crm_time_is_defined()
nrwahl2 May 1, 2026
f48b44c
Refactor: libcrmcommon: New pcmk__time_text()
nrwahl2 May 1, 2026
254db34
API: libcrmcommon: Deprecate crm_time_as_string()
nrwahl2 May 1, 2026
210b010
Refactor: libcrmcommon: New pcmk__time_fmt_date flag
nrwahl2 May 1, 2026
1a87c31
API: libcrmcommon: Deprecate crm_time_log_date
nrwahl2 May 1, 2026
a8f657b
Refactor: libcrmcommon: New pcmk__time_fmt_time
nrwahl2 May 1, 2026
14c8972
API: libcrmcommon: Deprecate crm_time_log_timeofday
nrwahl2 May 1, 2026
6e72cc1
Refactor: libcrmcommon: New pcmk__time_fmt_timezone
nrwahl2 May 1, 2026
f3eeca6
API: libcrmcommon: Deprecate crm_time_log_with_timezone
nrwahl2 May 1, 2026
98ffefb
Refactor: libcrmcommon: Some best practices in duration_as_string()
nrwahl2 Jul 7, 2026
8e6bb08
Refactor: libcrmcommon: Drop QB_ABS() call in duration_as_string()
nrwahl2 Jul 7, 2026
b7396bd
Refactor: libcrmcommon: New pcmk__time_fmt_duration
nrwahl2 May 1, 2026
76fb1fa
API: libcrmcommon: Deprecate crm_time_log_duration
nrwahl2 May 1, 2026
65af0be
Refactor: libcrmcommon: New pcmk__time_fmt_ordinal
nrwahl2 May 1, 2026
dfa59a3
API: libcrmcommon: Deprecate crm_time_ordinal
nrwahl2 May 1, 2026
7602c06
Refactor: libcrmcommon: New pcmk__time_fmt_weeks
nrwahl2 May 1, 2026
fda5a52
API: libcrmcommon: Deprecate crm_time_weeks
nrwahl2 May 1, 2026
9c49f8a
Refactor: libcrmcommon: New pcmk__time_fmt_seconds
nrwahl2 May 1, 2026
48dbeb1
API: libcrmcommon: Deprecate crm_time_seconds
nrwahl2 May 1, 2026
774909f
Refactor: libcrmcommon: New pcmk__time_fmt_epoch
nrwahl2 May 1, 2026
98bd5c0
API: libcrmcommon: Deprecate crm_time_epoch
nrwahl2 May 1, 2026
f8ceae5
Refactor: libcrmcommon: New pcmk__time_fmt_usecs
nrwahl2 May 1, 2026
19b017c
API: libcrmcommon: Deprecate crm_time_usecs
nrwahl2 May 1, 2026
43c9f2d
Refactor: libcrmcommon: New pcmk__time_compare()
nrwahl2 May 1, 2026
abe2e5b
API: libcrmcommon: Deprecate crm_time_compare()
nrwahl2 May 1, 2026
483aa8d
Refactor: libcrmcommon: Ignore crm_time_get_timeofday() return value
nrwahl2 May 1, 2026
a2d5093
Refactor: libcrmcommon: New pcmk__time_get_timeofday()
nrwahl2 May 1, 2026
8c83522
API: libcrmcommon: Deprecate crm_time_get_timeofday()
nrwahl2 May 1, 2026
0e29e9e
Refactor: libcrmcommon: Ignore crm_time_get_gregorian() return value
nrwahl2 May 1, 2026
f8ec9db
Refactor: libcrmcommon: New pcmk__time_get_ymd()
nrwahl2 May 1, 2026
594a023
API: libcrmcommon: Deprecate crm_time_get_gregorian()
nrwahl2 May 1, 2026
845693e
Refactor: libcrmcommon: Drop crm_time_get_ordinal() internally
nrwahl2 May 1, 2026
12f7646
API: libcrmcommon: Deprecate crm_time_get_ordinal()
nrwahl2 May 1, 2026
abbc7e6
Refactor: libcrmcommon: New pcmk__time_get_seconds()
nrwahl2 May 1, 2026
b6e2151
API: libcrmcommon: Deprecate crm_time_get_seconds()
nrwahl2 May 1, 2026
b0d7916
Refactor: various: Drop unneeded parens for address-of operator
nrwahl2 Jul 6, 2026
0e9f631
Refactor: libcrmcommon: Best practices in pcmk__time_compare()
nrwahl2 Jul 7, 2026
d3ecad4
Refactor: libcrmcommon: Best practices for pcmk__time_get_timeofday()
nrwahl2 Jul 8, 2026
487411a
Refactor: libcrmcommon: Simplify duration case of pcmk__time_get_ymd()
nrwahl2 Jul 12, 2026
b90bc3f
Refactor: libcrmcommon: Set duration field in copy_time_to_utc()
nrwahl2 Jul 12, 2026
8a6f01d
Refactor: libcrmcommon: Unindent pcmk__time_get_ymd() and add Doxygen
nrwahl2 Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cts/cli/regression.dates.exp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ iso8601: Invalid interval specified: P1Y/2019-02-29 00:00:00Z
=#=#=#= End test: Invalid period - [P1Y/2019-02-29 00:00:00Z] - Invalid parameter (2) =#=#=#=
* Passed: iso8601 - Invalid period - [P1Y/2019-02-29 00:00:00Z]
=#=#=#= Begin test: Invalid period - [2019-01-01 00:00:00Z/P] =#=#=#=
crm_time_parse_duration error: 'P' is not a valid ISO 8601 time duration because nothing follows 'P'
pcmk__time_parse_duration error: 'P' is not a valid ISO 8601 time duration because nothing follows 'P'
iso8601: Invalid interval specified: 2019-01-01 00:00:00Z/P
=#=#=#= End test: Invalid period - [2019-01-01 00:00:00Z/P] - Invalid parameter (2) =#=#=#=
* Passed: iso8601 - Invalid period - [2019-01-01 00:00:00Z/P]
Expand Down
1 change: 0 additions & 1 deletion cts/cts-cli.in
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def sanitize_output(s):
(r'\((check_creation_disallowed.*)@.*\.c:[0-9]+\)', r'\1'),
(r'crm_feature_set="[^"]*" ', r''),
(r'@crm_feature_set=[0-9.]+, ', r''),
(r'\(crm_time_parse_duration@.*\.c:[0-9]+\)', r'crm_time_parse_duration'),
(r'\(parse_hms@.*\.c:[0-9]+\)', r'parse_hms'),
(re.escape(cts_cli_data), r'CTS_CLI_DATA'),
(r' default="[^"]*"', r' default=""'),
Expand Down
2 changes: 1 addition & 1 deletion daemons/attrd/attrd_cib.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ write_attribute(attribute_t *a, bool ignore_delay)
set_alert_attribute_value(alert_attribute_value, v);

// Save this value so we can log it when write completes
pcmk__str_update(&(v->requested), v->current);
pcmk__str_update(&v->requested, v->current);
}

if (private_updates) {
Expand Down
4 changes: 2 additions & 2 deletions daemons/controld/controld_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ do_ha_control(long long action, enum crmd_fsa_cause cause,

controld_election_init();

pcmk__str_update(&(controld_globals.our_uuid),
pcmk__str_update(&controld_globals.our_uuid,
pcmk__cluster_get_xml_id(node));

if (controld_globals.our_uuid == NULL) {
Expand Down Expand Up @@ -577,7 +577,7 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
controld_globals.node_pending_timeout /= 1000;

value = g_hash_table_lookup(config_hash, PCMK_OPT_CLUSTER_NAME);
pcmk__str_update(&(controld_globals.cluster_name), value);
pcmk__str_update(&controld_globals.cluster_name, value);

// Let subcomponents initialize their own static variables
controld_configure_election(config_hash);
Expand Down
10 changes: 5 additions & 5 deletions daemons/controld/controld_execd.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@ build_active_RAs(lrm_state_t * lrm_state, xmlNode * rsc_list)
pcmk__xe_set(xml_rsc, PCMK__META_CONTAINER, container);
}
}
controld_add_resource_history_xml(xml_rsc, &(entry->rsc), entry->failed,
controld_add_resource_history_xml(xml_rsc, &entry->rsc, entry->failed,
lrm_state->node_name);
controld_add_resource_history_xml(xml_rsc, &(entry->rsc), entry->last,
controld_add_resource_history_xml(xml_rsc, &entry->rsc, entry->last,
lrm_state->node_name);
for (gIter = entry->recurring_op_list; gIter != NULL; gIter = gIter->next) {
controld_add_resource_history_xml(xml_rsc, &(entry->rsc), gIter->data,
controld_add_resource_history_xml(xml_rsc, &entry->rsc, gIter->data,
lrm_state->node_name);
}
}
Expand Down Expand Up @@ -1627,7 +1627,7 @@ construct_op(const lrm_state_t *lrm_state, const xmlNode *rsc_op,
pcmk__scan_min_int(op_timeout, &op->timeout, 0);

if (pcmk__uint_from_hash(params, CRM_META "_" PCMK_META_INTERVAL, 0,
&(op->interval_ms)) != pcmk_rc_ok) {
&op->interval_ms) != pcmk_rc_ok) {
op->interval_ms = 0;
}

Expand Down Expand Up @@ -2017,7 +2017,7 @@ do_lrm_rsc_op(lrm_state_t *lrm_state, lrmd_rsc_info_t *rsc, xmlNode *msg,
pending->rsc_id = pcmk__str_copy(rsc->id);
pending->start_time = time(NULL);
pending->user_data = pcmk__str_copy(op->user_data);
pcmk__xe_get_time(msg, PCMK_OPT_SHUTDOWN_LOCK, &(pending->lock_time));
pcmk__xe_get_time(msg, PCMK_OPT_SHUTDOWN_LOCK, &pending->lock_time);
g_hash_table_replace(lrm_state->active_ops, call_id_s, pending);

if ((op->interval_ms > 0)
Expand Down
34 changes: 17 additions & 17 deletions daemons/controld/controld_remote_ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ free_cmd(void *user_data)
free(cmd->rsc_id);
free(cmd->action);
free(cmd->userdata);
pcmk__reset_result(&(cmd->result));
pcmk__reset_result(&cmd->result);
lrmd_key_value_freeall(cmd->params);
free(cmd);
}
Expand Down Expand Up @@ -344,7 +344,7 @@ static void
check_remote_node_state(const remote_ra_cmd_t *cmd)
{
/* Only successful actions can change node state */
if (!pcmk__result_ok(&(cmd->result))) {
if (!pcmk__result_ok(&cmd->result)) {
return;
}

Expand Down Expand Up @@ -416,7 +416,7 @@ report_remote_ra_result(remote_ra_cmd_t * cmd)
cmd->result.exit_reason);

if (pcmk__is_set(cmd->status, cmd_reported_success)
&& !pcmk__result_ok(&(cmd->result))) {
&& !pcmk__result_ok(&cmd->result)) {

op.t_rcchange = time(NULL);
/* This edge case will likely never ever occur, but if it does the
Expand Down Expand Up @@ -486,7 +486,7 @@ retry_start_cmd_cb(void *data)
if (remaining > 0) {
rc = handle_remote_ra_start(lrm_state, cmd, remaining * 1000);
} else {
pcmk__set_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__set_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_TIMEOUT,
"Not enough time remains to retry remote connection");
}
Expand Down Expand Up @@ -535,7 +535,7 @@ monitor_timeout_cb(void *data)
pcmk__info("Timed out waiting for remote poke response from %s%s",
cmd->rsc_id, ((lrm_state != NULL)? "" : " (no LRM state)"));
cmd->monitor_timeout_id = 0;
pcmk__set_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR, PCMK_EXEC_TIMEOUT,
pcmk__set_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR, PCMK_EXEC_TIMEOUT,
"Remote executor did not respond");

if (lrm_state && lrm_state->remote_ra_data) {
Expand Down Expand Up @@ -676,7 +676,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
if ((op->connection_rc == -ENOKEY)
|| (op->connection_rc == -EKEYREJECTED)) {
// Hard error, don't retry
pcmk__set_result(&(cmd->result), PCMK_OCF_INVALID_PARAM,
pcmk__set_result(&cmd->result, PCMK_OCF_INVALID_PARAM,
PCMK_EXEC_ERROR,
pcmk_strerror(op->connection_rc));

Expand All @@ -690,15 +690,15 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
pcmk__trace("Not enough time before timeout (%ds) to "
"reschedule start",
remaining);
pcmk__format_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__format_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_TIMEOUT,
"%s without enough time to retry",
pcmk_strerror(op->connection_rc));
}

} else {
lrm_state_reset_tables(lrm_state, TRUE);
pcmk__set_result(&(cmd->result), PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
pcmk__set_result(&cmd->result, PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
lrm_remote_set_flags(lrm_state, remote_active);
}

Expand All @@ -719,7 +719,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
* For this function, if we get the poke pack, it is always a success. Pokes
* only fail if the send fails, or the response times out. */
if (!pcmk__is_set(cmd->status, cmd_reported_success)) {
pcmk__set_result(&(cmd->result), PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
pcmk__set_result(&cmd->result, PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
report_remote_ra_result(cmd);
cmd_set_flags(cmd, cmd_reported_success);
}
Expand All @@ -741,7 +741,7 @@ remote_lrm_op_callback(lrmd_event_data_t * op)
if (pcmk__is_set(ra_data->status, remote_active)
&& !pcmk__is_set(cmd->status, cmd_cancel)) {

pcmk__set_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__set_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_ERROR,
"Remote connection unexpectedly dropped "
"during monitor");
Expand Down Expand Up @@ -791,7 +791,7 @@ handle_remote_ra_stop(lrm_state_t * lrm_state, remote_ra_cmd_t * cmd)
lrm_state->remote_ra_data->cur_cmd = NULL;

if (cmd) {
pcmk__set_result(&(cmd->result), PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
pcmk__set_result(&cmd->result, PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
report_remote_ra_result(cmd);
}
}
Expand Down Expand Up @@ -825,7 +825,7 @@ handle_remote_ra_start(lrm_state_t * lrm_state, remote_ra_cmd_t * cmd, int timeo
rc = controld_connect_remote_executor(lrm_state, server, port,
timeout_used);
if (rc != pcmk_rc_ok) {
pcmk__format_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__format_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_ERROR,
"Could not connect to Pacemaker Remote node %s: %s",
lrm_state->node_name, pcmk_rc_str(rc));
Expand Down Expand Up @@ -877,12 +877,12 @@ handle_remote_ra_exec(void *user_data)
if (lrm_state_is_connected(lrm_state) == TRUE) {
rc = lrm_state_poke_connection(lrm_state);
if (rc < 0) {
pcmk__set_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__set_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_ERROR, pcmk_strerror(rc));
}
} else {
rc = -1;
pcmk__set_result(&(cmd->result), PCMK_OCF_NOT_RUNNING,
pcmk__set_result(&cmd->result, PCMK_OCF_NOT_RUNNING,
PCMK_EXEC_DONE, "Remote connection inactive");
}

Expand Down Expand Up @@ -918,7 +918,7 @@ handle_remote_ra_exec(void *user_data)
} else if (strcmp(cmd->action, PCMK_ACTION_MIGRATE_TO) == 0) {
lrm_remote_clear_flags(lrm_state, takeover_complete);
lrm_remote_set_flags(lrm_state, expect_takeover);
pcmk__set_result(&(cmd->result), PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
pcmk__set_result(&cmd->result, PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
report_remote_ra_result(cmd);

} else if (pcmk__str_any_of(cmd->action, PCMK_ACTION_RELOAD,
Expand All @@ -932,7 +932,7 @@ handle_remote_ra_exec(void *user_data)
* of "reload-agent". An OCF 1.1 "reload" would be a no-op anyway,
* so this would work for that purpose as well.
*/
pcmk__set_result(&(cmd->result), PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
pcmk__set_result(&cmd->result, PCMK_OCF_OK, PCMK_EXEC_DONE, NULL);
report_remote_ra_result(cmd);
}

Expand Down Expand Up @@ -1031,7 +1031,7 @@ fail_all_monitor_cmds(GList * list)
for (gIter = rm_list; gIter != NULL; gIter = gIter->next) {
cmd = gIter->data;

pcmk__set_result(&(cmd->result), PCMK_OCF_UNKNOWN_ERROR,
pcmk__set_result(&cmd->result, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_ERROR, "Lost connection to remote executor");
pcmk__trace("Pre-emptively failing %s %s (interval=%u, %s)",
cmd->action, cmd->rsc_id, cmd->interval_ms, cmd->userdata);
Expand Down
10 changes: 5 additions & 5 deletions daemons/controld/controld_timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,26 +331,26 @@ controld_configure_fsa_timers(GHashTable *options)

// Election timer
value = g_hash_table_lookup(options, PCMK_OPT_DC_DEADTIME);
pcmk_parse_interval_spec(value, &(election_timer->period_ms));
pcmk_parse_interval_spec(value, &election_timer->period_ms);

// Integration timer
value = g_hash_table_lookup(options, PCMK_OPT_JOIN_INTEGRATION_TIMEOUT);
pcmk_parse_interval_spec(value, &(integration_timer->period_ms));
pcmk_parse_interval_spec(value, &integration_timer->period_ms);

// Finalization timer
value = g_hash_table_lookup(options, PCMK_OPT_JOIN_FINALIZATION_TIMEOUT);
pcmk_parse_interval_spec(value, &(finalization_timer->period_ms));
pcmk_parse_interval_spec(value, &finalization_timer->period_ms);

// Shutdown escalation timer
value = g_hash_table_lookup(options, PCMK_OPT_SHUTDOWN_ESCALATION);
pcmk_parse_interval_spec(value, &(shutdown_escalation_timer->period_ms));
pcmk_parse_interval_spec(value, &shutdown_escalation_timer->period_ms);
pcmk__debug("Shutdown escalation occurs if DC has not responded to request "
"in %ums",
shutdown_escalation_timer->period_ms);

// Transition timer
value = g_hash_table_lookup(options, PCMK_OPT_TRANSITION_DELAY);
pcmk_parse_interval_spec(value, &(transition_timer->period_ms));
pcmk_parse_interval_spec(value, &transition_timer->period_ms);

// Recheck interval
value = g_hash_table_lookup(options, PCMK_OPT_CLUSTER_RECHECK_INTERVAL);
Expand Down
6 changes: 3 additions & 3 deletions daemons/controld/controld_utils.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2025 the Pacemaker project contributors
* Copyright 2004-2026 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand Down Expand Up @@ -693,8 +693,8 @@ update_dc(xmlNode * msg)
}

controld_globals.dc_name = NULL; // freed as last_dc
pcmk__str_update(&(controld_globals.dc_name), welcome_from);
pcmk__str_update(&(controld_globals.dc_version), dc_version);
pcmk__str_update(&controld_globals.dc_name, welcome_from);
pcmk__str_update(&controld_globals.dc_version, dc_version);

if (pcmk__str_eq(controld_globals.dc_name, last_dc, pcmk__str_casei)) {
/* do nothing */
Expand Down
2 changes: 1 addition & 1 deletion daemons/controld/pacemaker-controld.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ main(int argc, char **argv)
goto done;
}

if (pcmk__log_output_new(&(controld_globals.logger_out)) != pcmk_rc_ok) {
if (pcmk__log_output_new(&controld_globals.logger_out) != pcmk_rc_ok) {
exit_code = CRM_EX_FATAL;
goto done;
}
Expand Down
2 changes: 1 addition & 1 deletion daemons/execd/execd_alerts.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ execd_process_alert_exec(pcmk__client_t *client, xmlNode *request)

cb_data->client_id = pcmk__str_copy(client->id);

pcmk__xe_get_int(request, PCMK__XA_LRMD_CALLID, &(cb_data->call_id));
pcmk__xe_get_int(request, PCMK__XA_LRMD_CALLID, &cb_data->call_id);

action = services_alert_create(alert_id, alert_path, alert_timeout, params,
alert_sequence_no, cb_data);
Expand Down
Loading