mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
avoid using deprecated udev logging functions
In systemd >= 218, the udev_set_log_fn method has been marked deprecated and turned into a no-op. Nothing in the udev client library will print to stderr by default anymore, so we can just stop installing a logging hook for new enough udev.
This commit is contained in:
@@ -340,7 +340,7 @@ static int udevGenerateDeviceName(struct udev_device *device,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_UDEV_LOGGING
|
||||
typedef void (*udevLogFunctionPtr)(struct udev *udev,
|
||||
int priority,
|
||||
const char *file,
|
||||
@@ -373,6 +373,7 @@ udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
|
||||
|
||||
VIR_FREE(format);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int udevTranslatePCIIds(unsigned int vendor,
|
||||
@@ -1759,8 +1760,10 @@ static int nodeStateInitialize(bool privileged,
|
||||
* its return value.
|
||||
*/
|
||||
udev = udev_new();
|
||||
#if HAVE_UDEV_LOGGING
|
||||
/* cast to get rid of missing-format-attribute warning */
|
||||
udev_set_log_fn(udev, (udevLogFunctionPtr) udevLogFunction);
|
||||
#endif
|
||||
|
||||
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||
if (priv->udev_monitor == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user