Skip to content

Commit 8bc78d0

Browse files
committed
Refactor: daemons: Add attrd_cluster_disconnect.
And move the definition of attrd_cluster into attrdd_corosync.c where it belongs.
1 parent b447d0e commit 8bc78d0

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

daemons/attrd/attrd_corosync.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include "pacemaker-attrd.h"
2525

26+
pcmk_cluster_t *attrd_cluster = NULL;
27+
2628
/*!
2729
* \internal
2830
* \brief Nodes removed by \c attrd_peer_remove()
@@ -499,6 +501,13 @@ attrd_cluster_connect(void)
499501
return rc;
500502
}
501503

504+
void
505+
attrd_cluster_disconnect(void)
506+
{
507+
pcmk_cluster_disconnect(attrd_cluster);
508+
pcmk_cluster_free(attrd_cluster);
509+
}
510+
502511
void
503512
attrd_peer_clear_failure(pcmk__request_t *request)
504513
{

daemons/attrd/pacemaker-attrd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static pcmk__supported_format_t formats[] = {
5656
};
5757

5858
lrmd_t *the_lrmd = NULL;
59-
pcmk_cluster_t *attrd_cluster = NULL;
6059
crm_trigger_t *attrd_config_read = NULL;
6160
crm_exit_t attrd_exit_status = CRM_EX_OK;
6261

@@ -204,8 +203,7 @@ main(int argc, char **argv)
204203

205204
attrd_free_removed_peers();
206205
attrd_free_waitlist();
207-
pcmk_cluster_disconnect(attrd_cluster);
208-
pcmk_cluster_free(attrd_cluster);
206+
attrd_cluster_disconnect();
209207
g_hash_table_destroy(attributes);
210208
}
211209

daemons/attrd/pacemaker-attrd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ void attrd_free_removed_peers(void);
191191
void attrd_erase_removed_peer_attributes(void);
192192

193193
int attrd_cluster_connect(void);
194+
void attrd_cluster_disconnect(void);
194195
void attrd_broadcast_value(const attribute_t *a, const attribute_value_t *v);
195196
void attrd_peer_update(const pcmk__node_status_t *peer, xmlNode *xml,
196197
const char *host, bool filter);

0 commit comments

Comments
 (0)