]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
qnetd: Use log-common for nodelist debug dump
authorJan Friesse <jfriesse@redhat.com>
Mon, 12 Aug 2019 14:52:18 +0000 (16:52 +0200)
committerJan Friesse <jfriesse@redhat.com>
Mon, 12 Aug 2019 15:47:40 +0000 (17:47 +0200)
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
qdevices/qnetd-algo-ffsplit.c
qdevices/qnetd-log-debug.c
qdevices/qnetd-log-debug.h

index dbc5f8570f915d8304899b09bebd2801ceaadb2e..2fede523e8206829d1d14b0ce0fc2ee12118d01e 100644 (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);
index 926f3d4f9ae1b149c27ac148408c1965d8892119..dcffae19d7c9f5793e43e7e452c85148c5ca8657 100644 (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
index a6d22e368885364f6165015637653829255a22f9..fa74295b8feb287a9cdbab0226d9daf8ff96e95d 100644 (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);