qnetd: Use log-common for nodelist debug dump

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Jan Friesse 2019-08-12 16:52:18 +02:00
parent fed67019b4
commit c099509e72
3 changed files with 6 additions and 21 deletions

View File

@ -37,6 +37,7 @@
#include <string.h>
#include "log.h"
#include "log-common.h"
#include "qnetd-algo-ffsplit.h"
#include "qnetd-log-debug.h"
#include "qnetd-cluster-list.h"
@ -627,7 +628,7 @@ qnetd_algo_ffsplit_do(struct qnetd_client *client, int client_leaving,
log(LOG_DEBUG, "ffsplit: No quorate partition was selected");
} else {
log(LOG_DEBUG, "ffsplit: Quorate partition selected");
qnetd_log_debug_dump_node_list(client, quorate_partition_node_list);
log_common_debug_dump_node_list(quorate_partition_node_list);
}
qnetd_algo_ffsplit_update_nodes_state(client, client_leaving, quorate_partition_node_list);

View File

@ -33,6 +33,7 @@
*/
#include "log.h"
#include "log-common.h"
#include "qnetd-log-debug.h"
#include "utils.h"
@ -66,20 +67,6 @@ qnetd_log_debug_new_client_connected(struct qnetd_client *client)
qnetd_log_debug_dump_cluster(client->cluster);
}
void
qnetd_log_debug_dump_node_list(struct qnetd_client *client, const struct node_list *nodes)
{
struct node_list_entry *node_info;
log(LOG_DEBUG, " node list:");
TAILQ_FOREACH(node_info, nodes, entries) {
log(LOG_DEBUG, " node_id = "UTILS_PRI_NODE_ID", "
"data_center_id = "UTILS_PRI_DATACENTER_ID", "
"node_state = %s", node_info->node_id, node_info->data_center_id,
tlv_node_state_to_str(node_info->node_state));
}
}
void
qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
uint32_t msg_seq_num, int config_version_set, uint64_t config_version,
@ -96,7 +83,7 @@ qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
log(LOG_DEBUG, " config version = " UTILS_PRI_CONFIG_VERSION, config_version);
}
qnetd_log_debug_dump_node_list(client, nodes);
log_common_debug_dump_node_list(nodes);
}
void
@ -113,7 +100,7 @@ qnetd_log_debug_membership_node_list_received(struct qnetd_client *client,
log(LOG_DEBUG, " heuristics = %s ", tlv_heuristics_to_str(heuristics));
qnetd_log_debug_dump_node_list(client, nodes);
log_common_debug_dump_node_list(nodes);
}
void
@ -127,7 +114,7 @@ qnetd_log_debug_quorum_node_list_received(struct qnetd_client *client,
log(LOG_DEBUG, " msg seq num = "UTILS_PRI_MSG_SEQ, msg_seq_num);
log(LOG_DEBUG, " quorate = %u", quorate);
qnetd_log_debug_dump_node_list(client, nodes);
log_common_debug_dump_node_list(nodes);
}
void

View File

@ -46,9 +46,6 @@ extern void qnetd_log_debug_dump_cluster(struct qnetd_cluster *cluster);
extern void qnetd_log_debug_new_client_connected(struct qnetd_client *client);
extern void qnetd_log_debug_dump_node_list(struct qnetd_client *client,
const struct node_list *nodes);
extern void qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
uint32_t msg_seq_num, int config_version_set, uint64_t config_version,
const struct node_list *nodes, int initial);