Explorar o código

qnetd: Use log-common for nodelist debug dump

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse %!s(int64=6) %!d(string=hai) anos
pai
achega
c099509e72
Modificáronse 3 ficheiros con 6 adicións e 21 borrados
  1. 2 1
      qdevices/qnetd-algo-ffsplit.c
  2. 4 17
      qdevices/qnetd-log-debug.c
  3. 0 3
      qdevices/qnetd-log-debug.h

+ 2 - 1
qdevices/qnetd-algo-ffsplit.c

@@ -37,6 +37,7 @@
 #include <string.h>
 #include <string.h>
 
 
 #include "log.h"
 #include "log.h"
+#include "log-common.h"
 #include "qnetd-algo-ffsplit.h"
 #include "qnetd-algo-ffsplit.h"
 #include "qnetd-log-debug.h"
 #include "qnetd-log-debug.h"
 #include "qnetd-cluster-list.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");
 		log(LOG_DEBUG, "ffsplit: No quorate partition was selected");
 	} else {
 	} else {
 		log(LOG_DEBUG, "ffsplit: Quorate partition selected");
 		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);
 	qnetd_algo_ffsplit_update_nodes_state(client, client_leaving, quorate_partition_node_list);

+ 4 - 17
qdevices/qnetd-log-debug.c

@@ -33,6 +33,7 @@
  */
  */
 
 
 #include "log.h"
 #include "log.h"
+#include "log-common.h"
 #include "qnetd-log-debug.h"
 #include "qnetd-log-debug.h"
 #include "utils.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);
 	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
 void
 qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
 qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
     uint32_t msg_seq_num, int config_version_set, uint64_t config_version,
     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);
 		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
 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));
 	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
 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, "  msg seq num = "UTILS_PRI_MSG_SEQ, msg_seq_num);
 	log(LOG_DEBUG, "  quorate = %u", quorate);
 	log(LOG_DEBUG, "  quorate = %u", quorate);
 
 
-	qnetd_log_debug_dump_node_list(client, nodes);
+	log_common_debug_dump_node_list(nodes);
 }
 }
 
 
 void
 void

+ 0 - 3
qdevices/qnetd-log-debug.h

@@ -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_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,
 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,
     uint32_t msg_seq_num, int config_version_set, uint64_t config_version,
     const struct node_list *nodes, int initial);
     const struct node_list *nodes, int initial);