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"
}
-#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,
_("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);