Skip to content

Commit 32c75b7

Browse files
author
Ken Gaillot
committed
Refactor: libcrmcommon: remove dead code
This breaks the public API by removing the following symbols: * SERVICE_SCRIPT * crm_remote_baremetal * crm_remote_container * crm_remote_peer_cache_add() * crm_status_rstate (crm_status_nstate is now sent for all node types) * get_cib_copy() * pe_action_failure_is_fatal
1 parent 807ff7d commit 32c75b7

File tree

19 files changed

+10
-113
lines changed

19 files changed

+10
-113
lines changed

attrd/commands.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ attrd_lookup_or_create_value(GHashTable *values, const char *host, xmlNode *xml)
732732
}
733733

734734
/* Ensure this host is in the remote peer cache */
735-
crm_remote_peer_cache_add(host);
735+
CRM_ASSERT(crm_remote_peer_get(host) != NULL);
736736
}
737737

738738
if (v == NULL) {
@@ -966,7 +966,7 @@ attrd_election_cb(gpointer user_data)
966966
void
967967
attrd_peer_change_cb(enum crm_status_type kind, crm_node_t *peer, const void *data)
968968
{
969-
if ((kind == crm_status_nstate) || (kind == crm_status_rstate)) {
969+
if (kind == crm_status_nstate) {
970970
if (safe_str_eq(peer->state, CRM_NODE_MEMBER)) {
971971
/* If we're the writer, send new peers a list of all attributes
972972
* (unless it's a remote node, which doesn't run its own attrd)

cib/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ cib_peer_update_callback(enum crm_status_type type, crm_node_t * node, const voi
316316
break;
317317

318318
case crm_status_uname:
319-
case crm_status_rstate:
320319
case crm_status_nstate:
321320
if (cib_shutdown_flag && (crm_active_peers() < 2)
322321
&& crm_hash_table_size(client_connections) == 0) {

crmd/callbacks.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ peer_update_callback(enum crm_status_type type, crm_node_t * node, const void *d
113113
node->uname, state_text(node->state));
114114
return;
115115

116-
case crm_status_rstate:
117116
case crm_status_nstate:
118117
/* This callback should not be called unless the state actually
119118
* changed, but here's a failsafe just in case.

crmd/fsa_defines.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,9 @@ enum crmd_fsa_cause {
472472
C_HA_MESSAGE,
473473
C_CRMD_STATUS_CALLBACK,
474474
C_LRM_OP_CALLBACK,
475-
C_LRM_MONITOR_CALLBACK,
476475
C_TIMER_POPPED,
477476
C_SHUTDOWN,
478-
C_HEARTBEAT_FAILED,
479-
C_SUBSYSTEM_CONNECT,
480477
C_FSA_INTERNAL,
481-
C_ILLEGAL
482478
};
483479

484480
extern const char *fsa_input2string(enum crmd_fsa_input input);

crmd/messages.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,8 @@ register_fsa_input_adv(enum crmd_fsa_cause cause, enum crmd_fsa_input input,
146146
fsa_data->data_type = fsa_dt_lrm;
147147
break;
148148

149-
case C_SUBSYSTEM_CONNECT:
150-
case C_LRM_MONITOR_CALLBACK:
151149
case C_TIMER_POPPED:
152150
case C_SHUTDOWN:
153-
case C_HEARTBEAT_FAILED:
154-
case C_ILLEGAL:
155151
case C_UNKNOWN:
156152
case C_STARTUP:
157153
crm_err("Copying %s data (from %s)"

crmd/utils.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,27 +425,15 @@ fsa_cause2string(enum crmd_fsa_cause cause)
425425
case C_SHUTDOWN:
426426
causeAsText = "C_SHUTDOWN";
427427
break;
428-
case C_HEARTBEAT_FAILED:
429-
causeAsText = "C_HEARTBEAT_FAILED";
430-
break;
431-
case C_SUBSYSTEM_CONNECT:
432-
causeAsText = "C_SUBSYSTEM_CONNECT";
433-
break;
434428
case C_LRM_OP_CALLBACK:
435429
causeAsText = "C_LRM_OP_CALLBACK";
436430
break;
437-
case C_LRM_MONITOR_CALLBACK:
438-
causeAsText = "C_LRM_MONITOR_CALLBACK";
439-
break;
440431
case C_CRMD_STATUS_CALLBACK:
441432
causeAsText = "C_CRMD_STATUS_CALLBACK";
442433
break;
443434
case C_FSA_INTERNAL:
444435
causeAsText = "C_FSA_INTERNAL";
445436
break;
446-
case C_ILLEGAL:
447-
causeAsText = "C_ILLEGAL";
448-
break;
449437
}
450438

451439
if (causeAsText == NULL) {

fencing/commands.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,17 +2617,6 @@ handle_request(crm_client_t * client, uint32_t id, uint32_t flags, xmlNode * req
26172617
rc = stonith_level_remove(request, &device_id);
26182618
do_stonith_notify_level(call_options, op, rc, device_id);
26192619

2620-
} else if (crm_str_eq(op, STONITH_OP_CONFIRM, TRUE)) {
2621-
async_command_t *cmd = create_async_command(request);
2622-
xmlNode *reply = stonith_construct_async_reply(cmd, NULL, NULL, 0);
2623-
2624-
crm_xml_add(reply, F_STONITH_OPERATION, T_STONITH_NOTIFY);
2625-
crm_notice("Broadcasting manual fencing confirmation for node %s", cmd->victim);
2626-
send_cluster_message(NULL, crm_msg_stonith_ng, reply, FALSE);
2627-
2628-
free_async_command(cmd);
2629-
free_xml(reply);
2630-
26312620
} else if(safe_str_eq(op, CRM_OP_RM_NODE_CACHE)) {
26322621
int node_id = 0;
26332622
const char *name = NULL;

include/crm/cib/util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ int query_node_uname(cib_t * the_cib, const char *uuid, char **uname);
6464

6565
int set_standby(cib_t * the_cib, const char *uuid, const char *scope, const char *standby_value);
6666

67-
xmlNode *get_cib_copy(cib_t * cib);
6867
xmlNode *cib_get_generation(cib_t * cib);
6968

7069
void cib_metadata(void);

include/crm/cluster.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ enum crm_node_flags
5353
/* node is not a cluster node and should not be considered for cluster membership */
5454
crm_remote_node = 0x0001,
5555

56-
/* deprecated (not used by cluster) */
57-
crm_remote_container = 0x0002,
58-
crm_remote_baremetal = 0x0004,
59-
6056
/* node's cache entry is dirty */
6157
crm_node_dirty = 0x0010,
6258
};
@@ -134,7 +130,6 @@ int crm_remote_peer_cache_size(void);
134130

135131
/* Initialize and refresh the remote peer cache from a cib config */
136132
void crm_remote_peer_cache_refresh(xmlNode *cib);
137-
void crm_remote_peer_cache_add(const char *node_name);
138133
crm_node_t *crm_remote_peer_get(const char *node_name);
139134
void crm_remote_peer_cache_remove(const char *node_name);
140135

@@ -177,7 +172,6 @@ enum crm_status_type {
177172
crm_status_uname,
178173
crm_status_nstate,
179174
crm_status_processes,
180-
crm_status_rstate, /* remote node state */
181175
};
182176

183177
enum crm_ais_msg_types text2msg_type(const char *text);

include/crm/compatibility.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ static int ais_fd_sync = -1;
118118
#define PE_OBJ_T_GROUP "group"
119119
#define PE_OBJ_T_INCARNATION "clone"
120120
#define PE_OBJ_T_MASTER "master"
121+
#define SERVICE_SCRIPT "/sbin/service"
121122
#define SOCKET_LEN 1024
122123
#define XML_ATTR_TAGNAME F_XML_TAGNAME
123124
#define XML_ATTR_FILTER_TYPE "type-filter"
@@ -154,7 +155,10 @@ static int ais_fd_sync = -1;
154155
cib->cmds->register_callback(cib, id, 120, flag, data, #fn, fn); \
155156
} while(0)
156157
#define cib_default_options = cib_none
158+
#define crm_remote_baremetal 0x0004
159+
#define crm_remote_container 0x0002
157160
#define n_object_classes 3
161+
#define pe_action_failure_is_fatal 0x00020
158162
#define pe_rsc_munging 0x00000800ULL
159163
#define pe_rsc_try_reload 0x00001000ULL
160164
#define pe_rsc_shutdown 0x00020000ULL

0 commit comments

Comments
 (0)