Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b921325
Refactor: executor: Few best practices for execute_stonith_action()
nrwahl2 Apr 8, 2025
f675039
Refactor: libstonithd: Replace stonith__device_parameter_flags()
nrwahl2 Apr 9, 2025
3a3e158
Refactor: libstonithd: Rename host_arg to default_host_arg...
nrwahl2 Apr 9, 2025
1ade26e
Refactor: libstonithd: New stonith__default_host_arg()
nrwahl2 Apr 9, 2025
c5040dd
Refactor: libstonithd: Drop st_device_supports_parameter_{plug,port}
nrwahl2 Apr 9, 2025
3ce5d32
Refactor: fencer: st_device_supports_none -> fenced_df_none
nrwahl2 Apr 9, 2025
fd65161
Refactor: fencer: st_device_supports_list -> fenced_df_supports_list
nrwahl2 Apr 9, 2025
56b3515
Refactor: fencer: st_device_supports_on -> fenced_df_supports_on
nrwahl2 Apr 9, 2025
c94adc8
Refactor: fencer: st_device_supports_reboot -> fenced_df_supports_reboot
nrwahl2 Apr 9, 2025
04814dc
Refactor: fencer: st_device_supports_status -> fenced_df_supports_status
nrwahl2 Apr 9, 2025
a10cf9d
Refactor: fencer: stonith__set_device_flags -> fenced_device_set_flags
nrwahl2 Apr 10, 2025
857249e
Refactor: fencer: New fenced_df_auto_unfence flag
nrwahl2 Apr 10, 2025
e6fd665
Refactor: fencer: New fenced_df_verified flag
nrwahl2 Apr 10, 2025
466984b
Refactor: fencer: New fenced_df_api_registered flag
nrwahl2 Apr 10, 2025
350ead2
Refactor: fencer: New fenced_df_cib_registered flag
nrwahl2 Apr 10, 2025
092cdb8
Refactor: fencer: New fenced_df_dirty flag
nrwahl2 Apr 10, 2025
351f6cb
Refactor: fencer: st_client_flags -> fenced_notify_flags
nrwahl2 Apr 10, 2025
b0d7575
Refactor: fencer: st_callback_unknown -> fenced_nf_none
nrwahl2 Apr 10, 2025
1787302
Refactor: fencer: st_callback_notify_fence -> fenced_nf_fence_result
nrwahl2 Apr 10, 2025
f27812b
Refactor: fencer: st_callback_device_add -> fenced_nf_device_registered
nrwahl2 Apr 10, 2025
7e31fe7
Refactor: fencer: st_callback_device_del -> fenced_nf_device_removed
nrwahl2 Apr 10, 2025
a71c98d
Refactor: fencer: New fenced_nf_history_changed flag
nrwahl2 Apr 10, 2025
b88c65d
Refactor: fencer: New fenced_nf_history_synced flag
nrwahl2 Apr 10, 2025
fda36c9
Refactor: fencer: Best practices in get_stonith_flag()
nrwahl2 Apr 10, 2025
fc18120
Refactor: fencer: Drop notifications for topology level add/remove
nrwahl2 Apr 10, 2025
b423b60
Refactor: fencer: Drop redundant topology add/remove helpers
nrwahl2 Apr 10, 2025
f2f7a35
Refactor: fencer: Move fenced_set_protocol_error() out of header
nrwahl2 Apr 10, 2025
af96b65
API: libstonithd: Deprecate stonith_t and struct stonith_s
nrwahl2 Apr 11, 2025
453a39b
API: libstonithd: Deprecate enum stonith_state
nrwahl2 Apr 11, 2025
8d2cf71
API: libstonithd: Deprecate stonith_api_operations_t
nrwahl2 Apr 11, 2025
dd6519b
Refactor: libstonithd: New stonith__api_new()
nrwahl2 Apr 11, 2025
d97746f
Doc: libstonithd: Update dlm warning to reflect that it's fixed upstream
nrwahl2 Apr 11, 2025
9cfbb35
API: libstonithd: Deprecate stonith_api_new()
nrwahl2 Apr 11, 2025
cd9aef4
Refactor: libstonithd: New stonith__api_free()
nrwahl2 Apr 11, 2025
00bd094
API: libstonithd: Deprecate stonith_api_delete()
nrwahl2 Apr 11, 2025
c425071
API: libstonithd: Deprecate stonith_dump_pending_callbacks()
nrwahl2 Apr 11, 2025
066df90
Test: fencer: Drop passive mode from cts-fence-helper
nrwahl2 Apr 11, 2025
b2b2458
Refactor: libstonithd: New stonith__api_dispatch()
nrwahl2 Apr 11, 2025
94af2de
API: libstonithd: Deprecate stonith_dispatch()
nrwahl2 Apr 11, 2025
c6d050b
Refactor: libstonithd: Drop parse_device_list()
nrwahl2 Apr 12, 2025
fa93bc9
Refactor: libstonithd: New stonith__key_value_add()
nrwahl2 Apr 12, 2025
d85dd08
API: libstonithd: Deprecate stonith_key_value_add()
nrwahl2 Apr 12, 2025
15be84b
Refactor: libstonithd: New stonith__key_value_freeall()
nrwahl2 Apr 12, 2025
2538786
API: libstonithd: Deprecate stonith_key_value_freeall()
nrwahl2 Apr 12, 2025
c4545a3
Refactor: libstonithd: New stonith__history_free()
nrwahl2 Apr 12, 2025
d2e80ec
API: libstonithd: Deprecate stonith_history_free()
nrwahl2 Apr 12, 2025
e6893db
Refactor: libstonithd: New stonith__api_connect_retry()
nrwahl2 Apr 12, 2025
92a7949
API: libstonithd: Deprecate stonith_api_connect_retry()
nrwahl2 Apr 12, 2025
a9f1749
Refactor: libstonithd: New stonith__op_state_text()
nrwahl2 Apr 12, 2025
3a5e87d
API: libstonithd: Deprecate stonith_op_state_str()
nrwahl2 Apr 12, 2025
8d2f6d7
Refactor: libstonithd: New stonith__agent_exists()
nrwahl2 Apr 12, 2025
6a6c043
API: libstonithd: Deprecate stonith_agent_exists()
nrwahl2 Apr 12, 2025
148751f
Refactor: libstonithd: New history_action_text()
nrwahl2 Apr 12, 2025
4126838
API: libstonithd: Deprecate stonith_action_str()
nrwahl2 Apr 12, 2025
1d0cfbb
Doc: libstonithd: Document what dlm uses
nrwahl2 Apr 12, 2025
e8b2dd7
Doc: libstonithd: Flag stonith API methods for later removal
nrwahl2 Apr 12, 2025
d2cff5d
Refactor: libstonithd: New parse_namespace()
nrwahl2 Apr 12, 2025
3fc5519
API: libstonithd: Deprecate stonith_text2namespace()
nrwahl2 Apr 12, 2025
f165ae5
Refactor: libstonithd: New namespace_text()
nrwahl2 Apr 12, 2025
8b74e29
API: libstonithd: Deprecate stonith_namespace2text()
nrwahl2 Apr 12, 2025
398eba6
API: libstonithd: Ignore namespace_s in stonith API validate method
nrwahl2 Apr 12, 2025
eb6ff9a
API: liblrmd: Ignore provider for stonith-class resource metadata calls
nrwahl2 Apr 12, 2025
f21d247
API: libstonithd: Ignore namespace_s in stonith API metadata method
nrwahl2 Apr 12, 2025
7d5667a
Refactor: libstonithd: New get_namespace_from_agent()
nrwahl2 Apr 12, 2025
ed3017a
API: libstonithd: Deprecate stonith_get_namespace()
nrwahl2 Apr 12, 2025
08bb4d8
API: libstonithd: Deprecate enum stonith_call_options and its values
nrwahl2 Apr 12, 2025
d9fe1ab
API: libstonithd: Deprecate enum op_state and its values
nrwahl2 Apr 12, 2025
1b77eb9
API: libstonithd: Deprecate enum stonith_namespace and its values
nrwahl2 Apr 12, 2025
f4c404a
API: libstonithd: Deprecate stonith_key_value_t
nrwahl2 Apr 12, 2025
5f18d91
API: libstonithd: Deprecate stonith_history_t
nrwahl2 Apr 12, 2025
91841e4
API: libstonithd: Deprecate stonith_event_t and struct stonith_event_s
nrwahl2 Apr 12, 2025
b083b53
API: libstonithd: Deprecate stonith_callback_data_t
nrwahl2 Apr 12, 2025
6718368
Refactor: libpacemaker: Drop pcmk__fence_installed() timeout argument
nrwahl2 Apr 15, 2025
1c01f1d
API: libpacemaker: Document that pcmk_fence_installed() ignores timeout
nrwahl2 Apr 15, 2025
a31d92c
Doc: libstonithd: Assume that list_agents() timeout will remain ignored
nrwahl2 Apr 15, 2025
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
10 changes: 5 additions & 5 deletions daemons/controld/controld_fencing.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ controld_timer_fencer_connect(gpointer user_data)
int rc = pcmk_ok;

if (stonith_api == NULL) {
stonith_api = stonith_api_new();
stonith_api = stonith__api_new();
if (stonith_api == NULL) {
crm_err("Could not connect to fencer: API memory allocation failed");
return G_SOURCE_REMOVE;
Expand All @@ -675,10 +675,10 @@ controld_timer_fencer_connect(gpointer user_data)

if (user_data == NULL) {
// Blocking (retry failures now until successful)
rc = stonith_api_connect_retry(stonith_api, crm_system_name, 30);
if (rc != pcmk_ok) {
rc = stonith__api_connect_retry(stonith_api, crm_system_name, 30);
if (rc != pcmk_rc_ok) {
crm_err("Could not connect to fencer in 30 attempts: %s "
QB_XS " rc=%d", pcmk_strerror(rc), rc);
QB_XS " rc=%d", pcmk_rc_str(rc), rc);
}
} else {
// Non-blocking (retry failures later in main loop)
Expand Down Expand Up @@ -766,7 +766,7 @@ do_stonith_history_sync(gpointer user_data)
stonith_api->cmds->history(stonith_api,
st_opt_sync_call | st_opt_broadcast,
NULL, &history, 5);
stonith_history_free(history);
stonith__history_free(history);
return TRUE;
} else {
crm_info("Skip triggering stonith history-sync as stonith is disconnected");
Expand Down
30 changes: 18 additions & 12 deletions daemons/execd/execd_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ execd_stonith_start(stonith_t *stonith_api, const lrmd_rsc_t *rsc,

g_hash_table_iter_init(&iter, cmd->params);
while (g_hash_table_iter_next(&iter, (gpointer *) & key, (gpointer *) & value)) {
device_params = stonith_key_value_add(device_params, key, value);
device_params = stonith__key_value_add(device_params, key, value);
}
}

Expand All @@ -1226,7 +1226,7 @@ execd_stonith_start(stonith_t *stonith_api, const lrmd_rsc_t *rsc,
cmd->rsc_id, rsc->provider,
rsc->type, device_params);

stonith_key_value_freeall(device_params, 1, 1);
stonith__key_value_freeall(device_params, true, true);
return rc;
}

Expand Down Expand Up @@ -1283,9 +1283,11 @@ execd_stonith_monitor(stonith_t *stonith_api, lrmd_rsc_t *rsc, lrmd_cmd_t *cmd)
static void
execute_stonith_action(lrmd_rsc_t *rsc, lrmd_cmd_t *cmd)
{
int rc = 0;
bool do_monitor = FALSE;
int rc = pcmk_ok;
const char *rc_s = NULL;
bool do_monitor = false;

// Don't free; belongs to pacemaker-execd.c
stonith_t *stonith_api = get_stonith_connection();

if (pcmk__str_eq(cmd->action, PCMK_ACTION_MONITOR, pcmk__str_casei)
Expand All @@ -1295,25 +1297,27 @@ execute_stonith_action(lrmd_rsc_t *rsc, lrmd_cmd_t *cmd)
rsc->fence_probe_result.execution_status,
rsc->fence_probe_result.exit_reason);
return;
}

} else if (stonith_api == NULL) {
if (stonith_api == NULL) {
stonith_action_complete(cmd, PCMK_OCF_UNKNOWN_ERROR,
PCMK_EXEC_NOT_CONNECTED,
"No connection to fencer");
return;
}

} else if (pcmk__str_eq(cmd->action, PCMK_ACTION_START, pcmk__str_casei)) {
if (pcmk__str_eq(cmd->action, PCMK_ACTION_START, pcmk__str_casei)) {
rc = execd_stonith_start(stonith_api, rsc, cmd);
if (rc == pcmk_ok) {
do_monitor = TRUE;
do_monitor = true;
}

} else if (pcmk__str_eq(cmd->action, PCMK_ACTION_STOP, pcmk__str_casei)) {
rc = execd_stonith_stop(stonith_api, rsc);

} else if (pcmk__str_eq(cmd->action, PCMK_ACTION_MONITOR,
pcmk__str_casei)) {
do_monitor = TRUE;
do_monitor = true;

} else {
stonith_action_complete(cmd, PCMK_OCF_UNIMPLEMENT_FEATURE,
Expand All @@ -1325,15 +1329,17 @@ execute_stonith_action(lrmd_rsc_t *rsc, lrmd_cmd_t *cmd)
if (do_monitor) {
rc = execd_stonith_monitor(stonith_api, rsc, cmd);
if (rc == pcmk_ok) {
// Don't clean up yet, we will find out result of the monitor later
// Don't clean up yet. We will get the result of the monitor later.
return;
}
}

if (rc != -pcmk_err_generic) {
rc_s = pcmk_strerror(rc);
}
stonith_action_complete(cmd,
((rc == pcmk_ok)? CRM_EX_OK : CRM_EX_ERROR),
stonith__legacy2status(rc),
((rc == -pcmk_err_generic)? NULL : pcmk_strerror(rc)));
((rc == pcmk_rc_ok)? CRM_EX_OK : CRM_EX_ERROR),
stonith__legacy2status(rc), rc_s);
}

static void
Expand Down
17 changes: 9 additions & 8 deletions daemons/execd/pacemaker-execd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the Pacemaker project contributors
* Copyright 2012-2025 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand All @@ -22,6 +22,7 @@
#include <crm/common/mainloop.h>
#include <crm/common/output_internal.h>
#include <crm/common/remote_internal.h>
#include <crm/fencing/internal.h> // stonith__api_new()
#include <crm/lrmd_internal.h>

#include "pacemaker-execd.h"
Expand Down Expand Up @@ -67,23 +68,23 @@ stonith_t *
get_stonith_connection(void)
{
if (stonith_api && stonith_api->state == stonith_disconnected) {
stonith_api_delete(stonith_api);
stonith__api_free(stonith_api);
stonith_api = NULL;
}

if (stonith_api == NULL) {
int rc = pcmk_ok;

stonith_api = stonith_api_new();
stonith_api = stonith__api_new();
if (stonith_api == NULL) {
crm_err("Could not connect to fencer: API memory allocation failed");
return NULL;
}
rc = stonith_api_connect_retry(stonith_api, crm_system_name, 10);
if (rc != pcmk_ok) {
rc = stonith__api_connect_retry(stonith_api, crm_system_name, 10);
if (rc != pcmk_rc_ok) {
crm_err("Could not connect to fencer in 10 attempts: %s "
QB_XS " rc=%d", pcmk_strerror(rc), rc);
stonith_api_delete(stonith_api);
QB_XS " rc=%d", pcmk_rc_str(rc), rc);
stonith__api_free(stonith_api);
stonith_api = NULL;
} else {
stonith_api_operations_t *cmds = stonith_api->cmds;
Expand Down Expand Up @@ -283,7 +284,7 @@ exit_executor(void)

crm_info("Terminating with %d client%s",
nclients, pcmk__plural_s(nclients));
stonith_api_delete(stonith_api);
stonith__api_free(stonith_api);
if (ipcs) {
mainloop_del_ipc_server(ipcs);
}
Expand Down
Loading