From 91268c715cf0293f0751de0450e4d0c06bea18d8 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 9 May 2019 15:23:19 +0200 Subject: [PATCH] node_device_udev: remove deprecated logging function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function was deprecated in udev 219 and all the supported OSes don't have older version of udev or systemd. Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- m4/virt-udev.m4 | 5 ---- src/node_device/node_device_udev.c | 41 ------------------------------ 2 files changed, 46 deletions(-) diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 index be7dba5d2d..cf977c650b 100644 --- a/m4/virt-udev.m4 +++ b/m4/virt-udev.m4 @@ -30,11 +30,6 @@ AC_DEFUN([LIBVIRT_CHECK_UDEV],[ fi if test "$with_udev" = "yes" ; then - PKG_CHECK_EXISTS([libudev >= 218], [with_udev_logging=no], [with_udev_logging=yes]) - if test "$with_udev_logging" = "yes" ; then - AC_DEFINE_UNQUOTED([HAVE_UDEV_LOGGING], 1, [whether libudev logging can be used]) - fi - old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$CFLAGS $UDEV_CFLAGS" diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 7dd9804a0e..5df2fd72f3 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -318,43 +318,6 @@ udevGenerateDeviceName(struct udev_device *device, } -#if HAVE_UDEV_LOGGING -typedef void -(*udevLogFunctionPtr)(struct udev *udev, - int priority, - const char *file, - int line, - const char *fn, - const char *format, - va_list args); - -static void -ATTRIBUTE_FMT_PRINTF(6, 0) -udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED, - int priority, - const char *file, - int line, - const char *fn, - const char *fmt, - va_list args) -{ - virBuffer buf = VIR_BUFFER_INITIALIZER; - char *format = NULL; - - virBufferAdd(&buf, fmt, -1); - virBufferTrim(&buf, "\n", -1); - - format = virBufferContentAndReset(&buf); - - virLogVMessage(&virLogSelf, - virLogPriorityFromSyslog(priority), - file, line, fn, NULL, format ? format : fmt, args); - - VIR_FREE(format); -} -#endif - - static int udevTranslatePCIIds(unsigned int vendor, unsigned int product, @@ -1872,10 +1835,6 @@ nodeStateInitialize(bool privileged, _("failed to create udev context")); goto cleanup; } -#if HAVE_UDEV_LOGGING - /* cast to get rid of missing-format-attribute warning */ - udev_set_log_fn(udev, (udevLogFunctionPtr) udevLogFunction); -#endif virObjectLock(priv); -- GitLab