Skip to content

Commit

Permalink
Merge pull request #1955 from kgaillot/fixes
Browse files Browse the repository at this point in the history
Miscellaneous unrelated small changes
  • Loading branch information
kgaillot authored Dec 5, 2019
2 parents 92b0c1d + dec3263 commit 33e28dc
Show file tree
Hide file tree
Showing 53 changed files with 1,155 additions and 702 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ publican.cfg
/doc/HTML
/doc/abi_dumps
/doc/abi-check
/doc/acls.html
/doc/api/*
/doc/compat_reports
/doc/crm_fencing.html
Expand Down Expand Up @@ -213,6 +212,7 @@ pacemaker-[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]
/cts/HBDummy
/doc/Clusters_from_Scratch.txt
/doc/Pacemaker_Explained.txt
/doc/acls.html
/fencing
/lrmd
/mcp
Expand Down
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1885,8 +1885,6 @@ CFLAGS_COPY="$CFLAGS"
AC_SUBST(CFLAGS_COPY)

AC_SUBST(LIBADD_DL) dnl extra flags for dynamic linking libraries
AC_SUBST(LIBADD_INTL) dnl extra flags for GNU gettext stuff...

AC_SUBST(LOCALE)

dnl Options for cleaning up the compiler output
Expand Down
4 changes: 1 addition & 3 deletions daemons/controld/controld_execd.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,7 @@ is_rsc_active(lrm_state_t * lrm_state, const char *rsc_id)

} else if (entry->last->rc == PCMK_OCF_OK
&& safe_str_eq(entry->last->op_type, CRMD_ACTION_MIGRATE)) {
/* a stricter check is too complex...
* leave that to the PE
*/
// A stricter check is too complex ... leave that to the scheduler
return FALSE;

} else if (entry->last->rc == PCMK_OCF_NOT_RUNNING) {
Expand Down
2 changes: 1 addition & 1 deletion daemons/controld/controld_fencing.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ tengine_stonith_notify(stonith_t *st, stonith_event_t *st_event)
* Unfortunately, the controller doesn't have a simple, reliable way
* to map hosts to guests. It might be possible to track this in the
* peer cache via crm_remote_peer_cache_refresh(). For now, we rely
* on the PE creating fence pseudo-events for the guests.
* on the scheduler creating fence pseudo-events for the guests.
*/

if (st_event->client_origin
Expand Down
2 changes: 1 addition & 1 deletion daemons/controld/controld_fsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ s_crmd_fsa_actions(fsa_data_t * fsa_data)
/*
* Low(er) priority actions
* Make sure the CIB is always updated before invoking the
* PE, and the PE before the TE
* scheduler, and the scheduler before the transition engine.
*/
} else if (fsa_actions & A_TE_HALT) {
do_fsa_action(fsa_data, A_TE_HALT, do_te_invoke);
Expand Down
4 changes: 2 additions & 2 deletions daemons/controld/controld_join_dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ do_dc_join_offer_one(long long action,
join_make_offer(NULL, member, NULL);
}

/* this was a genuine join request, cancel any existing
* transition and invoke the PE
/* This was a genuine join request; cancel any existing transition and
* invoke the scheduler.
*/
abort_transition(INFINITY, tg_restart, "Node join", NULL);

Expand Down
2 changes: 1 addition & 1 deletion daemons/controld/controld_schedulerd.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pe_subsystem_new()

/*!
* \internal
* \brief Send an XML message to the PE
* \brief Send an XML message to the scheduler
*
* \param[in] cmd XML message to send
*
Expand Down
4 changes: 2 additions & 2 deletions daemons/fenced/fenced_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ stonith_query(xmlNode * msg, const char *remote_peer, const char *client_id, int
const char *action = NULL;
const char *target = NULL;
int timeout = 0;
xmlNode *dev = get_xpath_object("//@" F_STONITH_ACTION, msg, LOG_TRACE);
xmlNode *dev = get_xpath_object("//@" F_STONITH_ACTION, msg, LOG_NEVER);

crm_element_value_int(msg, F_STONITH_TIMEOUT, &timeout);
if (dev) {
Expand Down Expand Up @@ -2703,7 +2703,7 @@ stonith_command(crm_client_t * client, uint32_t id, uint32_t flags, xmlNode * re
*/
char *op = crm_element_value_copy(request, F_STONITH_OPERATION);

if (get_xpath_object("//" T_STONITH_REPLY, request, LOG_TRACE)) {
if (get_xpath_object("//" T_STONITH_REPLY, request, LOG_NEVER)) {
is_reply = TRUE;
}

Expand Down
10 changes: 6 additions & 4 deletions daemons/fenced/fenced_history.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright 2009-2018 Andrew Beekhof <[email protected]>
* Copyright 2009-2019 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
* This source code is licensed under the GNU General Public License version 2
* or later (GPLv2+) WITHOUT ANY WARRANTY.
Expand Down Expand Up @@ -398,7 +400,7 @@ stonith_fence_history(xmlNode *msg, xmlNode **output,
{
int rc = 0;
const char *target = NULL;
xmlNode *dev = get_xpath_object("//@" F_STONITH_TARGET, msg, LOG_TRACE);
xmlNode *dev = get_xpath_object("//@" F_STONITH_TARGET, msg, LOG_NEVER);
xmlNode *out_history = NULL;

if (dev) {
Expand Down Expand Up @@ -439,8 +441,8 @@ stonith_fence_history(xmlNode *msg, xmlNode **output,
NULL);
} else if (remote_peer &&
!safe_str_eq(remote_peer, stonith_our_uname)) {
xmlNode *history =
get_xpath_object("//" F_STONITH_HISTORY_LIST, msg, LOG_TRACE);
xmlNode *history = get_xpath_object("//" F_STONITH_HISTORY_LIST,
msg, LOG_NEVER);
GHashTable *received_history =
history?stonith_xml_history_to_list(history):NULL;

Expand Down
5 changes: 3 additions & 2 deletions daemons/fenced/fenced_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ remote_op_done(remote_fencing_op_t * op, xmlNode * data, int rc, int dup)
}

if (!op->delegate && data && rc != -ENODEV && rc != -EHOSTUNREACH) {
xmlNode *ndata = get_xpath_object("//@" F_STONITH_DELEGATE, data, LOG_TRACE);
xmlNode *ndata = get_xpath_object("//@" F_STONITH_DELEGATE, data,
LOG_NEVER);
if(ndata) {
op->delegate = crm_element_value_copy(ndata, F_STONITH_DELEGATE);
} else {
Expand Down Expand Up @@ -963,7 +964,7 @@ void *
create_remote_stonith_op(const char *client, xmlNode * request, gboolean peer)
{
remote_fencing_op_t *op = NULL;
xmlNode *dev = get_xpath_object("//@" F_STONITH_TARGET, request, LOG_TRACE);
xmlNode *dev = get_xpath_object("//@" F_STONITH_TARGET, request, LOG_NEVER);
int call_options = 0;

init_stonith_remote_op_hash_table(&stonith_remote_op_list);
Expand Down
8 changes: 5 additions & 3 deletions daemons/fenced/pacemaker-fenced.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ node_has_attr(const char *node, const char *name, const char *value)
"/" XML_CIB_TAG_NODE "[@uname='%s']/" XML_TAG_ATTR_SETS
"/" XML_CIB_TAG_NVPAIR "[@name='%s' and @value='%s']",
node, name, value);
match = get_xpath_object(xpath, local_cib, LOG_TRACE);
match = get_xpath_object(xpath, local_cib, LOG_NEVER);

CRM_CHECK(n < XPATH_MAX, return FALSE);
return (match != NULL);
Expand Down Expand Up @@ -1051,7 +1051,8 @@ update_cib_cache_cb(const char *event, xmlNode * msg)

crm_peer_caches_refresh(local_cib);

stonith_enabled_xml = get_xpath_object("//nvpair[@name='stonith-enabled']", local_cib, LOG_TRACE);
stonith_enabled_xml = get_xpath_object("//nvpair[@name='stonith-enabled']",
local_cib, LOG_NEVER);
if (stonith_enabled_xml) {
stonith_enabled_s = crm_element_value(stonith_enabled_xml, XML_NVPAIR_ATTR_VALUE);
}
Expand All @@ -1060,7 +1061,8 @@ update_cib_cache_cb(const char *event, xmlNode * msg)
long timeout_ms = 0;
const char *value = NULL;

stonith_watchdog_xml = get_xpath_object("//nvpair[@name='stonith-watchdog-timeout']", local_cib, LOG_TRACE);
stonith_watchdog_xml = get_xpath_object("//nvpair[@name='stonith-watchdog-timeout']",
local_cib, LOG_NEVER);
if (stonith_watchdog_xml) {
value = crm_element_value(stonith_watchdog_xml, XML_NVPAIR_ATTR_VALUE);
}
Expand Down
9 changes: 4 additions & 5 deletions daemons/pacemakerd/pacemakerd.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ mcp_chown(const char *path, uid_t uid, gid_t gid)
*/
static int
pcmk_child_active(pcmk_child_t *child) {
static uid_t cl_uid = 0;
static gid_t cl_gid = 0;
uid_t cl_uid = 0;
gid_t cl_gid = 0;
const uid_t root_uid = 0;
const gid_t root_gid = 0;
const uid_t *ref_uid;
Expand All @@ -799,8 +799,7 @@ pcmk_child_active(pcmk_child_t *child) {
ref_uid = (child->uid != NULL) ? &cl_uid : &root_uid;
ref_gid = (child->uid != NULL) ? &cl_gid : &root_gid;

if (child->uid != NULL && !cl_uid && !cl_gid
&& crm_user_lookup(CRM_DAEMON_USER, &cl_uid, &cl_gid) < 0) {
if ((child->uid != NULL) && (pcmk_daemon_user(&cl_uid, &cl_gid) < 0)) {
crm_err("Could not find user and group IDs for user %s",
CRM_DAEMON_USER);
ret = -1;
Expand Down Expand Up @@ -1309,7 +1308,7 @@ main(int argc, char **argv)
}
}

if (crm_user_lookup(CRM_DAEMON_USER, &pcmk_uid, &pcmk_gid) < 0) {
if (pcmk_daemon_user(&pcmk_uid, &pcmk_gid) < 0) {
crm_err("Cluster user %s does not exist, aborting Pacemaker startup", CRM_DAEMON_USER);
crm_exit(CRM_EX_NOUSER);
}
Expand Down
2 changes: 1 addition & 1 deletion daemons/pacemakerd/pcmkd_corosync.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ mcp_read_config(void)

if(local_handle){
gid_t gid = 0;
if (crm_user_lookup(CRM_DAEMON_USER, NULL, &gid) < 0) {
if (pcmk_daemon_user(NULL, &gid) < 0) {
crm_warn("Could not authorize group with corosync " CRM_XS
" No group found for user %s", CRM_DAEMON_USER);

Expand Down
Loading

0 comments on commit 33e28dc

Please sign in to comment.