Przeglądaj źródła

Qdevice: Add format macro for nodeid, ring, ...

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 9 lat temu
rodzic
commit
59e2de05ef

+ 2 - 1
qdevices/qdevice-cmap.c

@@ -46,6 +46,7 @@
 #include "qdevice-log.h"
 #include "qdevice-log-debug.h"
 #include "qdevice-model.h"
+#include "utils.h"
 
 static uint32_t
 qdevice_cmap_autogenerate_node_id(const char *addr, int clear_node_high_byte)
@@ -260,7 +261,7 @@ qdevice_cmap_node_list_event(struct qdevice_instance *instance)
 
 	qdevice_log(LOG_DEBUG, "Node list changed");
 	if (config_version_set) {
-		qdevice_log(LOG_DEBUG, "  config_version = %"PRIu64, config_version);
+		qdevice_log(LOG_DEBUG, "  config_version = "UTILS_PRI_CONFIG_VERSION, config_version);
 	}
 	qdevice_log_debug_dump_node_list(&nlist);
 

+ 3 - 2
qdevices/qdevice-log-debug.c

@@ -34,6 +34,7 @@
 
 #include "qdevice-log-debug.h"
 #include "qdevice-log.h"
+#include "utils.h"
 
 void
 qdevice_log_debug_dump_node_list(const struct node_list *nlist)
@@ -46,8 +47,8 @@ qdevice_log_debug_dump_node_list(const struct node_list *nlist)
 	zi = 0;
 
 	TAILQ_FOREACH(node_info, nlist, entries) {
-		qdevice_log(LOG_DEBUG, "    %zu node_id = %"PRIx32", "
-		    "data_center_id = %"PRIx32", node_state = %s",
+		qdevice_log(LOG_DEBUG, "    %zu node_id = "UTILS_PRI_NODE_ID", "
+		    "data_center_id = "UTILS_PRI_DATACENTER_ID", node_state = %s",
 		    zi, node_info->node_id, node_info->data_center_id,
 		    tlv_node_state_to_str(node_info->node_state));
 		zi++;

+ 5 - 4
qdevices/qdevice-net-msg-received.c

@@ -40,6 +40,7 @@
 #include "qdevice-net-votequorum.h"
 #include "qdevice-net-echo-request-timer.h"
 #include "msg.h"
+#include "utils.h"
 
 /*
  * -1 - Incompatible tls combination
@@ -576,10 +577,10 @@ qdevice_net_msg_received_node_list_reply(struct qdevice_net_instance *instance,
 		break;
 	}
 	qdevice_log(LOG_DEBUG, "Received %s node list reply", str);
-	qdevice_log(LOG_DEBUG, "  seq = %"PRIu32, msg->seq_number);
+	qdevice_log(LOG_DEBUG, "  seq = "UTILS_PRI_MSG_SEQ, msg->seq_number);
 	qdevice_log(LOG_DEBUG, "  vote = %s", tlv_vote_to_str(msg->vote));
 	if (msg->ring_id_set) {
-		qdevice_log(LOG_DEBUG, "  ring id = (%"PRIx32".%"PRIx64")",
+		qdevice_log(LOG_DEBUG, "  ring id = ("UTILS_PRI_RING_ID")",
 		    msg->ring_id.node_id, msg->ring_id.seq);
 	}
 
@@ -666,7 +667,7 @@ qdevice_net_msg_received_ask_for_vote_reply(struct qdevice_net_instance *instanc
 	}
 
 	qdevice_log(LOG_DEBUG, "Received ask for vote reply");
-	qdevice_log(LOG_DEBUG, "  seq = %"PRIu32, msg->seq_number);
+	qdevice_log(LOG_DEBUG, "  seq = "UTILS_PRI_MSG_SEQ, msg->seq_number);
 	qdevice_log(LOG_DEBUG, "  vote = %s", tlv_vote_to_str(msg->vote));
 
 	result_vote = msg->vote;
@@ -712,7 +713,7 @@ qdevice_net_msg_received_vote_info(struct qdevice_net_instance *instance,
 	}
 
 	qdevice_log(LOG_DEBUG, "Received vote info");
-	qdevice_log(LOG_DEBUG, "  seq = %"PRIu32, msg->seq_number);
+	qdevice_log(LOG_DEBUG, "  seq = "UTILS_PRI_MSG_SEQ, msg->seq_number);
 	qdevice_log(LOG_DEBUG, "  vote = %s", tlv_vote_to_str(msg->vote));
 
 	result_vote = msg->vote;

+ 6 - 5
qdevices/qdevice-net-send.c

@@ -38,6 +38,7 @@
 #include "qdevice-cmap.h"
 #include "qdevice-net-votequorum.h"
 #include "msg.h"
+#include "utils.h"
 
 int
 qdevice_net_send_echo_request(struct qdevice_net_instance *instance)
@@ -144,7 +145,7 @@ qdevice_net_send_ask_for_vote(struct qdevice_net_instance *instance)
 
 	instance->last_msg_seq_num++;
 
-	qdevice_log(LOG_DEBUG, "Sending ask for vote seq = %"PRIu32,
+	qdevice_log(LOG_DEBUG, "Sending ask for vote seq = "UTILS_PRI_MSG_SEQ,
 	    instance->last_msg_seq_num);
 
 	if (msg_create_ask_for_vote(&send_buffer->buffer, instance->last_msg_seq_num) == 0) {
@@ -176,7 +177,7 @@ qdevice_net_send_config_node_list(struct qdevice_net_instance *instance,
 
 	instance->last_msg_seq_num++;
 
-	qdevice_log(LOG_DEBUG, "Sending config node list seq = %"PRIu32,
+	qdevice_log(LOG_DEBUG, "Sending config node list seq = "UTILS_PRI_MSG_SEQ,
 	    instance->last_msg_seq_num);
 	qdevice_log_debug_dump_node_list(nlist);
 
@@ -227,8 +228,8 @@ qdevice_net_send_membership_node_list(struct qdevice_net_instance *instance,
 
 	instance->last_msg_seq_num++;
 
-	qdevice_log(LOG_DEBUG, "Sending membership node list seq = %"PRIu32", "
-	    "ringid = (%"PRIx32".%"PRIx64").", instance->last_msg_seq_num,
+	qdevice_log(LOG_DEBUG, "Sending membership node list seq = "UTILS_PRI_MSG_SEQ", "
+	    "ringid = ("UTILS_PRI_RING_ID").", instance->last_msg_seq_num,
 	    ring_id->node_id, ring_id->seq);
 	qdevice_log_debug_dump_node_list(&nlist);
 
@@ -290,7 +291,7 @@ qdevice_net_send_quorum_node_list(struct qdevice_net_instance *instance,
 
 	instance->last_msg_seq_num++;
 
-	qdevice_log(LOG_DEBUG, "Sending quorum node list seq = %"PRIu32", quorate = %u",
+	qdevice_log(LOG_DEBUG, "Sending quorum node list seq = "UTILS_PRI_MSG_SEQ", quorate = %u",
 	    instance->last_msg_seq_num, quorate);
 	qdevice_log_debug_dump_node_list(&nlist);
 

+ 5 - 4
qdevices/qdevice-votequorum.c

@@ -38,6 +38,7 @@
 #include "qdevice-log.h"
 #include "qdevice-votequorum.h"
 #include "qdevice-model.h"
+#include "utils.h"
 
 static void
 qdevice_votequorum_quorum_notify_callback(votequorum_handle_t votequorum_handle,
@@ -57,7 +58,7 @@ qdevice_votequorum_quorum_notify_callback(votequorum_handle_t votequorum_handle,
 
 	qdevice_log(LOG_DEBUG, "  Node list (size = %"PRIu32"):", node_list_entries);
 	for (u32 = 0; u32 < node_list_entries; u32++) {
-		qdevice_log(LOG_DEBUG, "    %"PRIu32" nodeid = %"PRIx32", state = %"PRIu32,
+		qdevice_log(LOG_DEBUG, "    %"PRIu32" nodeid = "UTILS_PRI_NODE_ID", state = %"PRIu32,
 		    u32, node_list[u32].nodeid, node_list[u32].state);
 	}
 
@@ -93,12 +94,12 @@ qdevice_votequorum_node_list_notify_callback(votequorum_handle_t votequorum_hand
 	}
 
 	qdevice_log(LOG_DEBUG, "Votequorum nodelist notify callback:");
-	qdevice_log(LOG_DEBUG, "  Ring_id = (%"PRIx32".%"PRIx64")",
+	qdevice_log(LOG_DEBUG, "  Ring_id = ("UTILS_PRI_RING_ID")",
 	    votequorum_ring_id.nodeid, votequorum_ring_id.seq);
 
 	qdevice_log(LOG_DEBUG, "  Node list (size = %"PRIu32"):", node_list_entries);
 	for (u32 = 0; u32 < node_list_entries; u32++) {
-		qdevice_log(LOG_DEBUG, "    %"PRIu32" nodeid = %"PRIx32,
+		qdevice_log(LOG_DEBUG, "    %"PRIu32" nodeid = "UTILS_PRI_NODE_ID,
 		    u32, node_list[u32]);
 	}
 
@@ -131,7 +132,7 @@ qdevice_votequorum_expected_votes_notify_callback(votequorum_handle_t votequorum
 	}
 
 	qdevice_log(LOG_DEBUG, "Votequorum expected_votes notify callback:");
-	qdevice_log(LOG_DEBUG, "  Expected_votes: %"PRIu32, expected_votes);
+	qdevice_log(LOG_DEBUG, "  Expected_votes: "UTILS_PRI_EXPECTED_VOTES, expected_votes);
 
 	if (qdevice_model_votequorum_expected_votes_notify(instance, expected_votes) != 0) {
 		qdevice_log(LOG_DEBUG, "qdevice_votequorum_expected_votes_notify_callback returned error -> exit");

+ 6 - 5
qdevices/qnetd-algo-2nodelms.c

@@ -55,6 +55,7 @@
 #include "qnetd-log.h"
 #include "qnetd-cluster-list.h"
 #include "qnetd-algo-utils.h"
+#include "utils.h"
 
 struct qnetd_algo_2nodelms_info {
 	int num_config_nodes;
@@ -164,7 +165,7 @@ qnetd_algo_2nodelms_membership_node_list_received(struct qnetd_client *client,
 		node_count++;
 	}
 
-	qnetd_log(LOG_DEBUG, "algo-2nodelms: cluster %s (client %p nodeid %d) membership list has %d member nodes (ring ID %" PRIu64 ")", client->cluster_name, client, client->node_id, node_count, ring_id->seq);
+	qnetd_log(LOG_DEBUG, "algo-2nodelms: cluster %s (client %p nodeid "UTILS_PRI_NODE_ID") membership list has %d member nodes (ring ID "UTILS_PRI_RING_ID")", client->cluster_name, client, client->node_id, node_count, ring_id->node_id, ring_id->seq);
 
 	if (node_count == 2) {
 		qnetd_log(LOG_DEBUG, "algo-2nodelms: cluster %s running normally. Both nodes active", client->cluster_name);
@@ -177,7 +178,7 @@ qnetd_algo_2nodelms_membership_node_list_received(struct qnetd_client *client,
 	TAILQ_FOREACH(other_client, &client->cluster->client_list, cluster_entries) {
 		node_count++;
 
-		qnetd_log(LOG_DEBUG, "algo-2nodelms: seen nodeid %d on client %p (ring ID %d/%" PRIu64 ")", other_client->node_id, other_client, other_client->last_ring_id.node_id, other_client->last_ring_id.seq);
+		qnetd_log(LOG_DEBUG, "algo-2nodelms: seen nodeid "UTILS_PRI_NODE_ID" on client %p (ring ID "UTILS_PRI_RING_ID")", other_client->node_id, other_client, other_client->last_ring_id.node_id, other_client->last_ring_id.seq);
 		if (other_client->node_id < low_node_id) {
 			low_node_id = other_client->node_id;
 		}
@@ -254,7 +255,7 @@ qnetd_algo_2nodelms_quorum_node_list_received(struct qnetd_client *client,
 void
 qnetd_algo_2nodelms_client_disconnect(struct qnetd_client *client, int server_going_down)
 {
-	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "disconnect", client, client->cluster_name, client->node_id);
 
 	qnetd_log(LOG_INFO, "algo-2nodelms:   server going down %u", server_going_down);
@@ -272,7 +273,7 @@ qnetd_algo_2nodelms_ask_for_vote_received(struct qnetd_client *client, uint32_t
 {
 	struct qnetd_algo_2nodelms_info *info = client->algorithm_data;
 
-	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "asked for a vote", client, client->cluster_name, client->node_id);
 
 	if (info->last_result == 0) {
@@ -289,7 +290,7 @@ enum tlv_reply_error_code
 qnetd_algo_2nodelms_vote_info_reply_received(struct qnetd_client *client, uint32_t msg_seq_num)
 {
 
-	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_INFO, "algo-2nodelms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "replied back to vote info message", client, client->cluster_name, client->node_id);
 
 	return (TLV_REPLY_ERROR_CODE_NO_ERROR);

+ 5 - 4
qdevices/qnetd-algo-lms.c

@@ -57,6 +57,7 @@
 #include "qnetd-cluster-list.h"
 #include "qnetd-algo-utils.h"
 #include "qnetd-client-algo-timer.h"
+#include "utils.h"
 
 struct qnetd_algo_lms_info {
 	int num_config_nodes;
@@ -313,7 +314,7 @@ qnetd_algo_lms_quorum_node_list_received(struct qnetd_client *client,
 void
 qnetd_algo_lms_client_disconnect(struct qnetd_client *client, int server_going_down)
 {
-	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "disconnect", client, client->cluster_name, client->node_id);
 
 	qnetd_log(LOG_INFO, "algo-lms:   server going down %u", server_going_down);
@@ -330,7 +331,7 @@ qnetd_algo_lms_ask_for_vote_received(struct qnetd_client *client, uint32_t msg_s
     enum tlv_vote *result_vote)
 {
 	qnetd_log(LOG_DEBUG, " ");
-	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "asked for a vote", client, client->cluster_name, client->node_id);
 
 	return do_lms_algorithm(client, &client->last_ring_id, result_vote);
@@ -339,7 +340,7 @@ qnetd_algo_lms_ask_for_vote_received(struct qnetd_client *client, uint32_t msg_s
 enum tlv_reply_error_code
 qnetd_algo_lms_vote_info_reply_received(struct qnetd_client *client, uint32_t msg_seq_num)
 {
-	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "replied back to vote info message", client, client->cluster_name, client->node_id);
 
 	return (TLV_REPLY_ERROR_CODE_NO_ERROR);
@@ -351,7 +352,7 @@ qnetd_algo_lms_timer_callback(struct qnetd_client *client, int *reschedule_timer
 {
 	enum tlv_reply_error_code ret;
 
-	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "algo-lms: Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "Timer callback", client, client->cluster_name, client->node_id);
 
 	ret = do_lms_algorithm(client, &client->last_ring_id, result_vote);

+ 22 - 21
qdevices/qnetd-log-debug.c

@@ -34,6 +34,7 @@
 
 #include "qnetd-log.h"
 #include "qnetd-log-debug.h"
+#include "utils.h"
 
 void
 qnetd_log_debug_dump_cluster(struct qnetd_cluster *cluster)
@@ -42,7 +43,7 @@ qnetd_log_debug_dump_cluster(struct qnetd_cluster *cluster)
 
 	qnetd_log(LOG_DEBUG, "  cluster dump:");
 	TAILQ_FOREACH(client, &cluster->client_list, cluster_entries) {
-		qnetd_log(LOG_DEBUG, "    client = %p, node_id = %"PRIx32,
+		qnetd_log(LOG_DEBUG, "    client = %p, node_id = "UTILS_PRI_NODE_ID,
 		    client, client->node_id);
 	}
 }
@@ -56,7 +57,7 @@ qnetd_log_debug_new_client_connected(struct qnetd_client *client)
 	qnetd_log(LOG_DEBUG, "  tls started = %u", client->tls_started);
 	qnetd_log(LOG_DEBUG, "  tls peer certificate verified = %u",
 	    client->tls_peer_certificate_verified);
-	qnetd_log(LOG_DEBUG, "  node_id = %"PRIx32, client->node_id);
+	qnetd_log(LOG_DEBUG, "  node_id = "UTILS_PRI_NODE_ID, client->node_id);
 	qnetd_log(LOG_DEBUG, "  pointer = %p", client);
 
 	qnetd_log_debug_dump_cluster(client->cluster);
@@ -69,8 +70,8 @@ qnetd_log_debug_dump_node_list(struct qnetd_client *client, const struct node_li
 
 	qnetd_log(LOG_DEBUG, "  node list:");
 	TAILQ_FOREACH(node_info, nodes, entries) {
-		qnetd_log(LOG_DEBUG, "    node_id = %"PRIx32", "
-		    "data_center_id = %"PRIx32", "
+		qnetd_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));
 	}
@@ -82,14 +83,14 @@ qnetd_log_debug_config_node_list_received(struct qnetd_client *client,
     const struct node_list *nodes, int initial)
 {
 
-	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "sent %s node list.", client, client->cluster_name, client->node_id,
 	    (initial ? "initial" : "changed"));
 
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 
 	if (config_version_set) {
-		qnetd_log(LOG_DEBUG, "  config version %"PRIu64, config_version);
+		qnetd_log(LOG_DEBUG, "  config version " UTILS_PRI_CONFIG_VERSION, config_version);
 	}
 
 	qnetd_log_debug_dump_node_list(client, nodes);
@@ -100,12 +101,12 @@ qnetd_log_debug_membership_node_list_received(struct qnetd_client *client,
     uint32_t msg_seq_num, const struct tlv_ring_id *ring_id,
     const struct node_list *nodes)
 {
-	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "sent membership node list.", client, client->cluster_name, client->node_id);
 
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 
-	qnetd_log(LOG_DEBUG, "  ring id = (%"PRIx32".%"PRIx64")", ring_id->node_id, ring_id->seq);
+	qnetd_log(LOG_DEBUG, "  ring id = (" UTILS_PRI_RING_ID ")", ring_id->node_id, ring_id->seq);
 
 	qnetd_log_debug_dump_node_list(client, nodes);
 }
@@ -115,10 +116,10 @@ qnetd_log_debug_quorum_node_list_received(struct qnetd_client *client,
     uint32_t msg_seq_num, enum tlv_quorate quorate, const struct node_list *nodes)
 {
 
-	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "sent quorum node list.", client, client->cluster_name, client->node_id);
 
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 	qnetd_log(LOG_DEBUG, "  quorate = %u", quorate);
 
 	qnetd_log_debug_dump_node_list(client, nodes);
@@ -128,35 +129,35 @@ void
 qnetd_log_debug_client_disconnect(struct qnetd_client *client, int server_going_down)
 {
 
-	qnetd_log(LOG_DEBUG, "Client %p (init_received %u, cluster %s, node_id %"PRIx32
-		") disconnect%s", client, client->init_received, client->cluster_name,
-		client->node_id, (server_going_down ? " (server is going down)" : ""));
+	qnetd_log(LOG_DEBUG, "Client %p (init_received %u, cluster %s, node_id "
+	    UTILS_PRI_NODE_ID") disconnect%s", client, client->init_received, client->cluster_name,
+	    client->node_id, (server_going_down ? " (server is going down)" : ""));
 }
 
 void
 qnetd_log_debug_ask_for_vote_received(struct qnetd_client *client, uint32_t msg_seq_num)
 {
 
-	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "asked for a vote", client, client->cluster_name, client->node_id);
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 }
 
 void
 qnetd_log_debug_vote_info_reply_received(struct qnetd_client *client, uint32_t msg_seq_num)
 {
 
-	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id %"PRIx32") "
+	qnetd_log(LOG_DEBUG, "Client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") "
 	    "replied back to vote info message", client, client->cluster_name, client->node_id);
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 }
 
 void
 qnetd_log_debug_send_vote_info(struct qnetd_client *client, uint32_t msg_seq_num, enum tlv_vote vote)
 {
 
-	qnetd_log(LOG_DEBUG, "Sending vote info to client %p (cluster %s, node_id %"PRIx32") ",
+	qnetd_log(LOG_DEBUG, "Sending vote info to client %p (cluster %s, node_id "UTILS_PRI_NODE_ID") ",
 	    client, client->cluster_name, client->node_id);
-	qnetd_log(LOG_DEBUG, "  msg seq num %"PRIu32, msg_seq_num);
+	qnetd_log(LOG_DEBUG, "  msg seq num "UTILS_PRI_MSG_SEQ, msg_seq_num);
 	qnetd_log(LOG_DEBUG, "  vote %s", tlv_vote_to_str(vote));
 }

+ 11 - 0
qdevices/utils.h

@@ -38,6 +38,17 @@
 #include <sys/types.h>
 #include <inttypes.h>
 
+#define UTILS_PRI_NODE_ID		"%" PRIu32
+#define UTILS_PRI_DATACENTER_ID		"%" PRIu32
+/*
+#define UTILS_PRI_NODE_ID		"0x%" PRIx32
+#define UTILS_PRI_DATACENTER_ID		"0x%" PRIx32
+*/
+#define UTILS_PRI_MSG_SEQ		"%" PRIu32
+#define UTILS_PRI_RING_ID		"%" PRIx32 ".%" PRIx64
+#define UTILS_PRI_CONFIG_VERSION	"%" PRIu64
+#define UTILS_PRI_EXPECTED_VOTES	"%" PRIu32
+
 #ifdef __cplusplus
 extern "C" {
 #endif