and move qdevice-log-debug to log-common to share it with qnetd.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
qdevice-cmap.c qdevice-cmap.h \
qdevice-instance.c qdevice-instance.h node-list.c node-list.h \
utils.c utils.h qdevice-log.c qdevice-log.h \
- qdevice-log-debug.c qdevice-log-debug.h \
+ log-common.c log-common.h \
qdevice-votequorum.c qdevice-votequorum.h \
qdevice-model.c qdevice-model.h qdevice-model-net.c qdevice-model-net.h \
qdevice-net-instance.c qdevice-net-instance.h dynar.c dynar.h \
#include "dynar.h"
#include "dynar-str.h"
#include "dynar-getopt-lex.h"
+#include "log.h"
#include "qdevice-advanced-settings.h"
#include "qdevice-config.h"
#include "qdevice-cmap.h"
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Jan Friesse (jfriesse@redhat.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the Red Hat, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "log.h"
+#include "log-common.h"
+#include "utils.h"
+
+void
+log_common_debug_dump_node_list(const struct node_list *nlist)
+{
+ struct node_list_entry *node_info;
+ size_t zi;
+
+ log(LOG_DEBUG, " Node list:");
+
+ zi = 0;
+
+ TAILQ_FOREACH(node_info, nlist, entries) {
+ 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++;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Jan Friesse (jfriesse@redhat.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the Red Hat, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LOG_COMMON_H_
+#define _LOG_COMMON_H_
+
+#include "node-list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void log_common_debug_dump_node_list(const struct node_list *nlist);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LOG_COMMON_H_ */
#include <string.h>
#include <time.h>
-#include "qnet-config.h"
#include "log.h"
static int log_config_target = 0;
#include <stdint.h>
#include <netdb.h>
+#include "log.h"
#include "qdevice-config.h"
#include "qdevice-cmap.h"
#include "qdevice-log.h"
-#include "qdevice-log-debug.h"
+#include "log-common.h"
#include "qdevice-model.h"
#include "utils.h"
if (config_version_set) {
log(LOG_DEBUG, " config_version = "UTILS_PRI_CONFIG_VERSION, config_version);
}
- qdevice_log_debug_dump_node_list(&nlist);
+ log_common_debug_dump_node_list(&nlist);
if (qdevice_model_config_node_list_changed(instance, &nlist,
config_version_set, config_version) != 0) {
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "dynar.h"
#include "dynar-str.h"
+#include "log.h"
#include "qdevice-heuristics-exec-result.h"
#include "qdevice-heuristics-cmd.h"
#include "qdevice-heuristics-cmd-str.h"
#include "qdevice-heuristics-io.h"
-#include "qdevice-log.h"
static int
qdevice_heuristics_cmd_process_exec_result(struct qdevice_heuristics_instance *instance,
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <string.h>
+
+#include "log.h"
#include "qdevice-heuristics-io.h"
#include "qdevice-heuristics-log.h"
-#include "qdevice-log.h"
/*
* 1 - Line logged
#include <string.h>
#include <unistd.h>
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-heuristics.h"
#include "qdevice-heuristics-cmd.h"
#include "qdevice-heuristics-worker.h"
#include <string.h>
#include <stdio.h>
+#include "log.h"
#include "qdevice-config.h"
#include "qdevice-instance.h"
#include "qdevice-heuristics-exec-list.h"
-#include "qdevice-log.h"
#include "qdevice-model.h"
#include "utils.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qdevice-ipc-cmd.h"
-#include "qdevice-log.h"
#include "qdevice-model.h"
#include "dynar-str.h"
#include "utils.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qdevice-config.h"
#include "qdevice-ipc.h"
-#include "qdevice-log.h"
#include "unix-socket-ipc.h"
#include "dynar-simple-lex.h"
#include "dynar-str.h"
+++ /dev/null
-/*
- * Copyright (c) 2015-2019 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Jan Friesse (jfriesse@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name of the Red Hat, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "qdevice-log-debug.h"
-#include "qdevice-log.h"
-#include "utils.h"
-
-void
-qdevice_log_debug_dump_node_list(const struct node_list *nlist)
-{
- struct node_list_entry *node_info;
- size_t zi;
-
- log(LOG_DEBUG, " Node list:");
-
- zi = 0;
-
- TAILQ_FOREACH(node_info, nlist, entries) {
- 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++;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Jan Friesse (jfriesse@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name of the Red Hat, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _QDEVICE_LOG_DEBUG_H_
-#define _QDEVICE_LOG_DEBUG_H_
-
-#include "node-list.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void qdevice_log_debug_dump_node_list(const struct node_list *nlist);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _QDEVICE_LOG_DEBUG_H_ */
#include <poll.h>
+#include "log.h"
#include "qdevice-model.h"
#include "qdevice-model-net.h"
-#include "qdevice-log.h"
#include "qdevice-net-cast-vote-timer.h"
#include "qdevice-net-instance.h"
#include "qdevice-net-ipc-cmd.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-model.h"
#include "qdevice-model-net.h"
#include <string.h>
+#include "log.h"
#include "qdevice-net-algo-2nodelms.h"
-#include "qdevice-log.h"
#include "qdevice-net-send.h"
#include "qdevice-net-cast-vote-timer.h"
#include <string.h>
+#include "log.h"
#include "qdevice-net-algo-ffsplit.h"
-#include "qdevice-log.h"
#include "qdevice-net-send.h"
#include "qdevice-net-cast-vote-timer.h"
#include "qdevice-votequorum.h"
#include <string.h>
+#include "log.h"
#include "qdevice-net-algo-lms.h"
-#include "qdevice-log.h"
#include "qdevice-net-send.h"
#include "qdevice-net-cast-vote-timer.h"
#include <string.h>
+#include "log.h"
#include "qdevice-net-algo-test.h"
-#include "qdevice-log.h"
#include "qdevice-net-send.h"
#include "qdevice-net-cast-vote-timer.h"
#include <sys/types.h>
+#include "log.h"
#include "qnet-config.h"
#include "qdevice-net-algorithm.h"
-#include "qdevice-log.h"
#include "qdevice-net-algo-test.h"
#include "qdevice-net-algo-ffsplit.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qnet-config.h"
-#include "qdevice-log.h"
#include "qdevice-net-cast-vote-timer.h"
#include "qdevice-votequorum.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qdevice-net-algorithm.h"
#include "qdevice-net-echo-request-timer.h"
#include "qdevice-net-send.h"
-#include "qdevice-log.h"
static int
qdevice_net_echo_request_timer_callback(void *data1, void *data2)
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-net-algorithm.h"
#include "qdevice-net-cast-vote-timer.h"
#include "qdevice-net-heuristics.h"
#include <limits.h>
+#include "log.h"
#include "qdevice-config.h"
-#include "qdevice-log.h"
#include "qdevice-net-instance.h"
#include "qnet-config.h"
#include "utils.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qdevice-net-ipc-cmd.h"
-#include "qdevice-log.h"
#include "dynar-str.h"
#include "qdevice-net-algorithm.h"
#include "utils.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-net-algorithm.h"
#include "qdevice-net-cast-vote-timer.h"
#include "qdevice-net-heuristics.h"
#include <sslerr.h>
#include <secerr.h>
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-net-nss.h"
#include "qdevice-net-instance.h"
#include "qnet-config.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "qdevice-cmap.h"
#include "qdevice-net-poll.h"
-#include "qdevice-log.h"
#include "qdevice-net-send.h"
#include "qdevice-net-socket.h"
#include "qdevice-votequorum.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "qdevice-log.h"
-#include "qdevice-log-debug.h"
+#include "log.h"
+#include "log-common.h"
#include "qdevice-net-send.h"
#include "qdevice-net-votequorum.h"
#include "msg.h"
log(LOG_DEBUG, "Sending config node list seq = "UTILS_PRI_MSG_SEQ,
instance->last_msg_seq_num);
- qdevice_log_debug_dump_node_list(nlist);
+ log_common_debug_dump_node_list(nlist);
if (msg_create_node_list(&send_buffer->buffer, instance->last_msg_seq_num,
(initial ? TLV_NODE_LIST_TYPE_INITIAL_CONFIG : TLV_NODE_LIST_TYPE_CHANGED_CONFIG),
log(LOG_DEBUG, "Sending membership node list seq = "UTILS_PRI_MSG_SEQ", "
"ringid = ("UTILS_PRI_RING_ID"), heuristics = %s.", instance->last_msg_seq_num,
ring_id->node_id, ring_id->seq, tlv_heuristics_to_str(heuristics));
- qdevice_log_debug_dump_node_list(&nlist);
+ log_common_debug_dump_node_list(&nlist);
if (msg_create_node_list(&send_buffer->buffer, instance->last_msg_seq_num,
TLV_NODE_LIST_TYPE_MEMBERSHIP,
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);
+ log_common_debug_dump_node_list(&nlist);
if (msg_create_node_list(&send_buffer->buffer, instance->last_msg_seq_num,
TLV_NODE_LIST_TYPE_QUORUM,
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "log.h"
#include "msg.h"
#include "msgio.h"
#include "qnet-config.h"
-#include "qdevice-log.h"
#include "qdevice-net-msg-received.h"
#include "qdevice-net-nss.h"
#include "qdevice-net-send.h"
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "qdevice-log.h"
+#include "log.h"
#include "qdevice-net-votequorum.h"
enum tlv_node_state
#include <poll.h>
+#include "log.h"
#include "qdevice-config.h"
-#include "qdevice-log.h"
#include "qdevice-votequorum.h"
#include "qdevice-model.h"
#include "utils.h"