Просмотр исходного кода

log: Add function to display corosync errors

And use it across the codebase.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Jan Friesse 14 часов назад
Родитель
Сommit
2fe51a68fc

+ 1 - 1
man/corosync-qnetd.8

@@ -1,5 +1,5 @@
 .\"/*
 .\"/*
-.\" * Copyright (C) 2016-2020 Red Hat, Inc.
+.\" * Copyright (C) 2016-2026 Red Hat, Inc.
 .\" *
 .\" *
 .\" * All rights reserved.
 .\" * All rights reserved.
 .\" *
 .\" *

+ 3 - 2
qdevices/Makefile.am

@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2020 Red Hat, Inc.
+# Copyright (c) 2012-2026 Red Hat, Inc.
 #
 #
 # Authors: Jan Friesse (jfriesse@redhat.com)
 # Authors: Jan Friesse (jfriesse@redhat.com)
 #          Fabio M. Di Nitto (fdinitto@redhat.com)
 #          Fabio M. Di Nitto (fdinitto@redhat.com)
@@ -150,7 +150,8 @@ corosync_qdevice_SOURCES = corosync-qdevice.c \
                            qdevice-heuristics-result-notifier.c qdevice-heuristics-result-notifier.h \
                            qdevice-heuristics-result-notifier.c qdevice-heuristics-result-notifier.h \
                            log.c log.h pr-poll-loop.c pr-poll-loop.h \
                            log.c log.h pr-poll-loop.c pr-poll-loop.h \
                            qdevice-pr-poll-loop-cb.c qdevice-pr-poll-loop-cb.h \
                            qdevice-pr-poll-loop-cb.c qdevice-pr-poll-loop-cb.h \
-                           qdevice-pr-poll-loop.c qdevice-pr-poll-loop.h
+                           qdevice-pr-poll-loop.c qdevice-pr-poll-loop.h \
+                           log-corosync.h
 
 
 corosync_qdevice_tool_SOURCES = corosync-qdevice-tool.c unix-socket.c unix-socket.h dynar.c dynar.h \
 corosync_qdevice_tool_SOURCES = corosync-qdevice-tool.c unix-socket.c unix-socket.h dynar.c dynar.h \
                                 dynar-str.c dynar-str.h utils.c utils.h
                                 dynar-str.c dynar-str.h utils.c utils.h

+ 1 - 1
qdevices/corosync-qnetd.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/log-common.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2019 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 58 - 0
qdevices/log-corosync.h

@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2026 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_COROSYNC_H_
+#define _LOG_COROSYNC_H_
+
+#include <corosync/corotypes.h>
+
+#include <err.h>
+
+#include "log.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define log_corosync(priority, corosync_error, str) log_printf(priority, "%s (%d): %s", \
+    str, (int)corosync_error, cs_strerror(corosync_error))
+
+#define log_corosync_errx(eval, corosync_error, str) errx(eval, "%s (%d): %s", \
+    str, (int)corosync_error, cs_strerror(corosync_error))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LOG_COROSYNC_H_ */

+ 1 - 1
qdevices/nss-sock.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2019 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/nss-sock.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2019 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 16 - 15
qdevices/qdevice-cmap.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -42,6 +42,7 @@
 #include <netdb.h>
 #include <netdb.h>
 
 
 #include "log.h"
 #include "log.h"
+#include "log-corosync.h"
 #include "qdevice-config.h"
 #include "qdevice-config.h"
 #include "qdevice-cmap.h"
 #include "qdevice-cmap.h"
 #include "qdevice-log.h"
 #include "qdevice-log.h"
@@ -259,11 +260,11 @@ qdevice_cmap_init(struct qdevice_instance *instance)
 	}
 	}
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		errx(EXIT_FAILURE, "Failed to initialize the cmap API. Error %s", cs_strerror(res));
+		log_corosync_errx(EXIT_FAILURE, res, "Failed to initialize the cmap API");
 	}
 	}
 
 
 	if ((res = cmap_context_set(instance->cmap_handle, (void *)instance)) != CS_OK) {
 	if ((res = cmap_context_set(instance->cmap_handle, (void *)instance)) != CS_OK) {
-		errx(EXIT_FAILURE, "Can't set cmap context. Error %s", cs_strerror(res));
+		log_corosync_errx(EXIT_FAILURE, res, "Can't set cmap context");
 	}
 	}
 
 
 	cmap_fd_get(instance->cmap_handle, &instance->cmap_poll_fd);
 	cmap_fd_get(instance->cmap_handle, &instance->cmap_poll_fd);
@@ -366,8 +367,8 @@ qdevice_cmap_reload_cb(cmap_handle_t cmap_handle, cmap_track_handle_t cmap_track
 	logging_prefix_str = "logging.";
 	logging_prefix_str = "logging.";
 	heuristics_prefix_str = "quorum.device.heuristics.";
 	heuristics_prefix_str = "quorum.device.heuristics.";
 
 
-	if (cmap_context_get(cmap_handle, (const void **)&instance) != CS_OK) {
-		log(LOG_ERR, "Fatal error. Can't get cmap context");
+	if ((cs_res = cmap_context_get(cmap_handle, (const void **)&instance)) != CS_OK) {
+		log_corosync(LOG_ERR, cs_res, "Fatal error. Can't get cmap context");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
@@ -443,7 +444,7 @@ qdevice_cmap_add_track(struct qdevice_instance *instance)
 	    NULL, &instance->cmap_reload_track_handle);
 	    NULL, &instance->cmap_reload_track_handle);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_ERR, "Can't initialize cmap totemconfig_reload_in_progress tracking");
+		log_corosync(LOG_ERR, res, "Can't initialize cmap totemconfig_reload_in_progress tracking");
 		return (-1);
 		return (-1);
 	}
 	}
 
 
@@ -453,7 +454,7 @@ qdevice_cmap_add_track(struct qdevice_instance *instance)
 	    NULL, &instance->cmap_nodelist_track_handle);
 	    NULL, &instance->cmap_nodelist_track_handle);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_ERR, "Can't initialize cmap nodelist tracking");
+		log_corosync(LOG_ERR, res, "Can't initialize cmap nodelist tracking");
 		return (-1);
 		return (-1);
 	}
 	}
 
 
@@ -463,7 +464,7 @@ qdevice_cmap_add_track(struct qdevice_instance *instance)
 	    NULL, &instance->cmap_logging_track_handle);
 	    NULL, &instance->cmap_logging_track_handle);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_ERR, "Can't initialize logging tracking");
+		log_corosync(LOG_ERR, res, "Can't initialize logging tracking");
 		return (-1);
 		return (-1);
 	}
 	}
 
 
@@ -473,7 +474,7 @@ qdevice_cmap_add_track(struct qdevice_instance *instance)
 	    NULL, &instance->cmap_heuristics_track_handle);
 	    NULL, &instance->cmap_heuristics_track_handle);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_ERR, "Can't initialize logging tracking");
+		log_corosync(LOG_ERR, res, "Can't initialize qdevice heuristics tracking");
 		return (-1);
 		return (-1);
 	}
 	}
 
 
@@ -487,22 +488,22 @@ qdevice_cmap_del_track(struct qdevice_instance *instance)
 
 
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_reload_track_handle);
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_reload_track_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't delete cmap totemconfig_reload_in_progress tracking");
+		log_corosync(LOG_WARNING, res, "Can't delete cmap totemconfig_reload_in_progress tracking");
 	}
 	}
 
 
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_nodelist_track_handle);
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_nodelist_track_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't delete cmap nodelist tracking");
+		log_corosync(LOG_WARNING, res, "Can't delete cmap nodelist tracking");
 	}
 	}
 
 
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_logging_track_handle);
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_logging_track_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't delete cmap logging tracking");
+		log_corosync(LOG_WARNING, res, "Can't delete cmap logging tracking");
 	}
 	}
 
 
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_heuristics_track_handle);
 	res = cmap_track_delete(instance->cmap_handle, instance->cmap_heuristics_track_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't delete cmap heuristics tracking");
+		log_corosync(LOG_WARNING, res, "Can't delete cmap heuristics tracking");
 	}
 	}
 
 
 	return (0);
 	return (0);
@@ -516,7 +517,7 @@ qdevice_cmap_destroy(struct qdevice_instance *instance)
 	res = cmap_finalize(instance->cmap_handle);
 	res = cmap_finalize(instance->cmap_handle);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't finalize cmap. Error %s", cs_strerror(res));
+		log_corosync(LOG_WARNING, res, "Can't finalize cmap");
 	}
 	}
 }
 }
 
 
@@ -535,7 +536,7 @@ qdevice_cmap_dispatch(struct qdevice_instance *instance)
 	res = cmap_dispatch(instance->cmap_handle, CS_DISPATCH_ALL);
 	res = cmap_dispatch(instance->cmap_handle, CS_DISPATCH_ALL);
 
 
 	if (res != CS_OK && res != CS_ERR_TRY_AGAIN) {
 	if (res != CS_OK && res != CS_ERR_TRY_AGAIN) {
-		log(LOG_ERR, "Can't dispatch cmap messages");
+		log_corosync(LOG_ERR, res, "Can't dispatch cmap messages");
 
 
 		return (-1);
 		return (-1);
 	}
 	}

+ 9 - 8
qdevices/qdevice-instance.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -36,6 +36,7 @@
 #include <stdio.h>
 #include <stdio.h>
 
 
 #include "log.h"
 #include "log.h"
+#include "log-corosync.h"
 #include "qdevice-config.h"
 #include "qdevice-config.h"
 #include "qdevice-instance.h"
 #include "qdevice-instance.h"
 #include "qdevice-heuristics-exec-list.h"
 #include "qdevice-heuristics-exec-list.h"
@@ -182,8 +183,7 @@ qdevice_instance_configure_from_cmap_heuristics(struct qdevice_instance *instanc
 		 */
 		 */
 		cs_err = cmap_iter_init(instance->cmap_handle, "quorum.device.heuristics.exec_", &iter_handle);
 		cs_err = cmap_iter_init(instance->cmap_handle, "quorum.device.heuristics.exec_", &iter_handle);
 		if (cs_err != CS_OK) {
 		if (cs_err != CS_OK) {
-			log(LOG_ERR, "Can't iterate quorum.device.heuristics.exec_ keys. "
-			    "Error %s", cs_strerror(cs_err));
+			log_corosync(LOG_ERR, cs_err, "Can't iterate quorum.device.heuristics.exec_ keys");
 
 
 			return (-1);
 			return (-1);
 		}
 		}
@@ -259,9 +259,10 @@ int
 qdevice_instance_configure_from_cmap(struct qdevice_instance *instance)
 qdevice_instance_configure_from_cmap(struct qdevice_instance *instance)
 {
 {
 	char *str;
 	char *str;
+	cs_error_t cs_err;
 
 
-	if (cmap_get_string(instance->cmap_handle, "quorum.device.model", &str) != CS_OK) {
-		log(LOG_ERR, "Can't read quorum.device.model cmap key.");
+	if ((cs_err = cmap_get_string(instance->cmap_handle, "quorum.device.model", &str)) != CS_OK) {
+		log_corosync(LOG_ERR, cs_err, "Can't read quorum.device.model cmap key");
 
 
 		return (-1);
 		return (-1);
 	}
 	}
@@ -274,9 +275,9 @@ qdevice_instance_configure_from_cmap(struct qdevice_instance *instance)
 	}
 	}
 	free(str);
 	free(str);
 
 
-	if (cmap_get_uint32(instance->cmap_handle, "runtime.votequorum.this_node_id",
-	    &instance->node_id) != CS_OK) {
-		log(LOG_ERR, "Unable to retrieve this node nodeid.");
+	if ((cs_err = cmap_get_uint32(instance->cmap_handle, "runtime.votequorum.this_node_id",
+	    &instance->node_id)) != CS_OK) {
+		log_corosync(LOG_ERR, cs_err, "Unable to retrieve this node nodeid");
 
 
 		return (-1);
 		return (-1);
 	}
 	}

+ 1 - 1
qdevices/qdevice-net-nss.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2019 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qdevice-net-nss.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2016 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qdevice-net-socket.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 22 - 21
qdevices/qdevice-votequorum.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -35,6 +35,7 @@
 #include <poll.h>
 #include <poll.h>
 
 
 #include "log.h"
 #include "log.h"
+#include "log-corosync.h"
 #include "qdevice-config.h"
 #include "qdevice-config.h"
 #include "qdevice-votequorum.h"
 #include "qdevice-votequorum.h"
 #include "qdevice-model.h"
 #include "qdevice-model.h"
@@ -47,9 +48,10 @@ qdevice_votequorum_quorum_notify_callback(votequorum_handle_t votequorum_handle,
 {
 {
 	struct qdevice_instance *instance;
 	struct qdevice_instance *instance;
 	uint32_t u32;
 	uint32_t u32;
+	cs_error_t res;
 
 
-	if (votequorum_context_get(votequorum_handle, (void **)&instance) != CS_OK) {
-		log(LOG_CRIT, "Fatal error. Can't get votequorum context");
+	if ((res = votequorum_context_get(votequorum_handle, (void **)&instance)) != CS_OK) {
+		log_corosync(LOG_CRIT, res, "Fatal error. Can't get votequorum context");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
@@ -119,9 +121,10 @@ qdevice_votequorum_node_list_notify_callback(votequorum_handle_t votequorum_hand
 {
 {
 	struct qdevice_instance *instance;
 	struct qdevice_instance *instance;
 	uint32_t u32;
 	uint32_t u32;
+	cs_error_t res;
 
 
-	if (votequorum_context_get(votequorum_handle, (void **)&instance) != CS_OK) {
-		log(LOG_CRIT, "Fatal error. Can't get votequorum context");
+	if ((res = votequorum_context_get(votequorum_handle, (void **)&instance)) != CS_OK) {
+		log_corosync(LOG_CRIT, res, "Fatal error. Can't get votequorum context");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
@@ -173,9 +176,10 @@ qdevice_votequorum_expected_votes_notify_callback(votequorum_handle_t votequorum
     uint64_t context, uint32_t expected_votes)
     uint64_t context, uint32_t expected_votes)
 {
 {
 	struct qdevice_instance *instance;
 	struct qdevice_instance *instance;
+	cs_error_t res;
 
 
-	if (votequorum_context_get(votequorum_handle, (void **)&instance) != CS_OK) {
-		log(LOG_CRIT, "Fatal error. Can't get votequorum context");
+	if ((res = votequorum_context_get(votequorum_handle, (void **)&instance)) != CS_OK) {
+		log_corosync(LOG_CRIT, res, "Fatal error. Can't get votequorum context");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
@@ -219,24 +223,24 @@ qdevice_votequorum_init(struct qdevice_instance *instance)
 	}
 	}
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_CRIT, "Failed to initialize the votequorum API. Error %s", cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Failed to initialize the votequorum API");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
 	if ((res = votequorum_qdevice_register(votequorum_handle,
 	if ((res = votequorum_qdevice_register(votequorum_handle,
 	    instance->advanced_settings->votequorum_device_name)) != CS_OK) {
 	    instance->advanced_settings->votequorum_device_name)) != CS_OK) {
-		log(LOG_CRIT, "Can't register votequorum device. Error %s", cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Can't register votequorum device");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
 	if ((res = votequorum_context_set(votequorum_handle, (void *)instance)) != CS_OK) {
 	if ((res = votequorum_context_set(votequorum_handle, (void *)instance)) != CS_OK) {
-		log(LOG_CRIT, "Can't set votequorum context. Error %s", cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Can't set votequorum context");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
 	if ((res = votequorum_getinfo(votequorum_handle, VOTEQUORUM_QDEVICE_NODEID,
 	if ((res = votequorum_getinfo(votequorum_handle, VOTEQUORUM_QDEVICE_NODEID,
 	    &vq_info)) != CS_OK) {
 	    &vq_info)) != CS_OK) {
-		log(LOG_CRIT, "Can't get votequorum information. Error %s", cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Can't get votequorum information");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 	instance->vq_expected_votes = vq_info.node_expected_votes;
 	instance->vq_expected_votes = vq_info.node_expected_votes;
@@ -247,8 +251,7 @@ qdevice_votequorum_init(struct qdevice_instance *instance)
 
 
 	if ((res = votequorum_trackstart(instance->votequorum_handle, 0,
 	if ((res = votequorum_trackstart(instance->votequorum_handle, 0,
 	    CS_TRACK_CHANGES)) != CS_OK) {
 	    CS_TRACK_CHANGES)) != CS_OK) {
-		log(LOG_CRIT, "Can't start tracking votequorum changes. Error %s",
-		    cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Can't start tracking votequorum changes");
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
@@ -269,20 +272,19 @@ qdevice_votequorum_destroy(struct qdevice_instance *instance)
 
 
 	res = votequorum_trackstop(instance->votequorum_handle);
 	res = votequorum_trackstop(instance->votequorum_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Can't stop tracking votequorum changes. Error %s",
-		    cs_strerror(res));
+		log_corosync(LOG_WARNING, res, "Can't stop tracking votequorum changes");
 	}
 	}
 
 
 	res = votequorum_qdevice_unregister(instance->votequorum_handle,
 	res = votequorum_qdevice_unregister(instance->votequorum_handle,
 		instance->advanced_settings->votequorum_device_name);
 		instance->advanced_settings->votequorum_device_name);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Unable to unregister votequorum device. Error %s", cs_strerror(res));
+		log_corosync(LOG_WARNING, res, "Unable to unregister votequorum device");
 	}
 	}
 
 
 	res = votequorum_finalize(instance->votequorum_handle);
 	res = votequorum_finalize(instance->votequorum_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_WARNING, "Unable to finalize votequorum. Error %s", cs_strerror(res));
+		log_corosync(LOG_WARNING, res, "Unable to finalize votequorum");
 	}
 	}
 }
 }
 
 
@@ -315,7 +317,7 @@ qdevice_votequorum_dispatch(struct qdevice_instance *instance)
 	res = votequorum_dispatch(instance->votequorum_handle, CS_DISPATCH_ALL);
 	res = votequorum_dispatch(instance->votequorum_handle, CS_DISPATCH_ALL);
 
 
 	if (res != CS_OK && res != CS_ERR_TRY_AGAIN) {
 	if (res != CS_OK && res != CS_ERR_TRY_AGAIN) {
-		log(LOG_ERR, "Can't dispatch votequorum messages");
+		log_corosync(LOG_ERR, res, "Can't dispatch votequorum messages");
 
 
 		return (-1);
 		return (-1);
 	}
 	}
@@ -339,8 +341,7 @@ qdevice_votequorum_poll(struct qdevice_instance *instance, int cast_vote)
 		if (res == CS_ERR_MESSAGE_ERROR) {
 		if (res == CS_ERR_MESSAGE_ERROR) {
 			log(LOG_INFO, "qdevice_votequorum_poll called with old ring id");
 			log(LOG_INFO, "qdevice_votequorum_poll called with old ring id");
 		} else {
 		} else {
-			log(LOG_CRIT, "Can't call votequorum_qdevice_poll. Error %s",
-			    cs_strerror(res));
+			log_corosync(LOG_CRIT, res, "Can't call votequorum_qdevice_poll");
 
 
 			return (-1);
 			return (-1);
 		}
 		}
@@ -377,7 +378,7 @@ qdevice_votequorum_master_wins(struct qdevice_instance *instance, int allow)
 	    instance->advanced_settings->votequorum_device_name, final_allow);
 	    instance->advanced_settings->votequorum_device_name, final_allow);
 
 
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		log(LOG_CRIT, "Can't set master wins. Error %s", cs_strerror(res));
+		log_corosync(LOG_CRIT, res, "Can't set master wins");
 
 
 		return (-1);
 		return (-1);
 	}
 	}

+ 1 - 1
qdevices/qnet-config.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qnetd-advanced-settings.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qnetd-advanced-settings.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qnetd-client-msg-received.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qnetd-instance.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *

+ 1 - 1
qdevices/qnetd-instance.h

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2015-2020 Red Hat, Inc.
+ * Copyright (c) 2015-2026 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *