Skip to content
Open
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
63c955c
API: libcrmcommon: Deprecate crm_time_calculate_duration()
nrwahl2 Apr 30, 2026
90d276e
Refactor: libcrmcommon: New pcmk__time_parse_duration()
nrwahl2 Apr 30, 2026
ab7373c
API: libcrmcommon: Deprecate crm_time_parse_duration()
nrwahl2 Apr 30, 2026
cc4b6ca
Refactor: libcrmcommon: Clean up includes in scheduler.h
nrwahl2 May 1, 2026
9f3d7bd
Refactor: various: Drop crm_time_new_undefined() internally
nrwahl2 May 1, 2026
75e562a
API: libcrmcommon: Deprecate crm_time_new_undefined()
nrwahl2 May 1, 2026
d43b9cf
Refactor: libcrmcommon: New pcmk__time_is_initialized()
nrwahl2 May 1, 2026
96e1c61
API: libcrmcommon: Deprecate crm_time_is_defined()
nrwahl2 May 1, 2026
5d45bef
Refactor: libcrmcommon: New pcmk__time_text()
nrwahl2 May 1, 2026
69d2d31
API: libcrmcommon: Deprecate crm_time_as_string()
nrwahl2 May 1, 2026
e900c11
Refactor: libcrmcommon: New pcmk__time_fmt_date flag
nrwahl2 May 1, 2026
0f69e66
API: libcrmcommon: Deprecate crm_time_log_date
nrwahl2 May 1, 2026
93c12ec
Refactor: libcrmcommon: New pcmk__time_fmt_time
nrwahl2 May 1, 2026
37dbf74
API: libcrmcommon: Deprecate crm_time_log_timeofday
nrwahl2 May 1, 2026
0906f95
Refactor: libcrmcommon: New pcmk__time_fmt_timezone
nrwahl2 May 1, 2026
ece7691
API: libcrmcommon: Deprecate crm_time_log_with_timezone
nrwahl2 May 1, 2026
2ff3630
Refactor: libcrmcommon: Some best practices in duration_as_string()
nrwahl2 Jul 7, 2026
0f6ccd4
Refactor: libcrmcommon: Drop QB_ABS() call in duration_as_string()
nrwahl2 Jul 7, 2026
b945641
Refactor: libcrmcommon: New pcmk__time_fmt_duration
nrwahl2 May 1, 2026
2ca4d62
API: libcrmcommon: Deprecate crm_time_log_duration
nrwahl2 May 1, 2026
6a5274e
Refactor: libcrmcommon: New pcmk__time_fmt_ordinal
nrwahl2 May 1, 2026
1dd0851
API: libcrmcommon: Deprecate crm_time_ordinal
nrwahl2 May 1, 2026
4616d85
Refactor: libcrmcommon: New pcmk__time_fmt_weeks
nrwahl2 May 1, 2026
63efc87
API: libcrmcommon: Deprecate crm_time_weeks
nrwahl2 May 1, 2026
5b458ab
Refactor: libcrmcommon: New pcmk__time_fmt_seconds
nrwahl2 May 1, 2026
c43548d
API: libcrmcommon: Deprecate crm_time_seconds
nrwahl2 May 1, 2026
58c4c61
Refactor: libcrmcommon: New pcmk__time_fmt_epoch
nrwahl2 May 1, 2026
f960317
API: libcrmcommon: Deprecate crm_time_epoch
nrwahl2 May 1, 2026
59a6871
Refactor: libcrmcommon: New pcmk__time_fmt_usecs
nrwahl2 May 1, 2026
39853d9
API: libcrmcommon: Deprecate crm_time_usecs
nrwahl2 May 1, 2026
cefe639
Refactor: libcrmcommon: New pcmk__time_compare()
nrwahl2 May 1, 2026
b9a802a
API: libcrmcommon: Deprecate crm_time_compare()
nrwahl2 May 1, 2026
c1c7116
Refactor: libcrmcommon: Ignore crm_time_get_timeofday() return value
nrwahl2 May 1, 2026
98eb723
Refactor: libcrmcommon: New pcmk__time_get_timeofday()
nrwahl2 May 1, 2026
3469507
API: libcrmcommon: Deprecate crm_time_get_timeofday()
nrwahl2 May 1, 2026
503395d
Refactor: libcrmcommon: Ignore crm_time_get_gregorian() return value
nrwahl2 May 1, 2026
97e3ce2
Refactor: libcrmcommon: New pcmk__time_get_ymd()
nrwahl2 May 1, 2026
8314601
API: libcrmcommon: Deprecate crm_time_get_gregorian()
nrwahl2 May 1, 2026
ea5eb1b
Refactor: libcrmcommon: Drop crm_time_get_ordinal() internally
nrwahl2 May 1, 2026
3780939
API: libcrmcommon: Deprecate crm_time_get_ordinal()
nrwahl2 May 1, 2026
dca830e
Refactor: libcrmcommon: New pcmk__time_get_seconds()
nrwahl2 May 1, 2026
5aa9080
API: libcrmcommon: Deprecate crm_time_get_seconds()
nrwahl2 May 1, 2026
6ffca50
Refactor: various: Drop unneeded parens for address-of operator
nrwahl2 Jul 6, 2026
d43a801
Refactor: libcrmcommon: Best practices in pcmk__time_compare()
nrwahl2 Jul 7, 2026
e995029
Refactor: libcrmcommon: Best practices for pcmk__time_get_timeofday()
nrwahl2 Jul 8, 2026
362ad26
Refactor: libcrmcommon: Simplify duration case of pcmk__time_get_ymd()
nrwahl2 Jul 12, 2026
1b0d1f2
Refactor: libcrmcommon: Set duration field in copy_time_to_utc()
nrwahl2 Jul 12, 2026
0f1d091
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 @@ -251,7 +251,6 @@ def sanitize_output(s):
(r'(<cib.*) cib-last-written="[^"]*"', 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 @@ -614,7 +614,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