]> xenbits.xensource.com Git - libvirt.git/commitdiff
node_device_udev: remove deprecated logging function
authorPavel Hrdina <phrdina@redhat.com>
Thu, 9 May 2019 13:23:19 +0000 (15:23 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 15 May 2019 08:42:44 +0000 (10:42 +0200)
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 <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
m4/virt-udev.m4
src/node_device/node_device_udev.c

index be7dba5d2df5c7fc0ee65bc10b414e04cd663f6a..cf977c650b4850e263ddce66f3c91542f8bde741 100644 (file)
@@ -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"
index 7dd9804a0e044521e29e74f5f26163853d031de5..5df2fd72f3dad4a9b330eaf931a202cb626ce6a9 100644 (file)
@@ -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);