From ee037ac9aff1eee6da6c28b32ddaf970f6b08fc1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 15 Feb 2010 11:00:38 +0100 Subject: [PATCH] Add support for "disable polling" udev property Do not poll a device which has UDISKS_DISABLE_POLLING set. Some known-broken CD-ROM drives cause a lot of CPU activity when being polled, so allow admins to suppress polling with a local udev rule like SUBSYSTEM=="block", ENV{ID_VENDOR}=="Optiarc*", ENV{ID_MODEL}=="*AD-7640S*", \ ENV{UDISKS_DISABLE_POLLING}="1" https://bugs.freedesktop.org/show_bug.cgi?id=26508 --- src/device.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/device.c b/src/device.c index 65e14f6..23fa2a6 100644 --- a/src/device.c +++ b/src/device.c @@ -3941,6 +3941,11 @@ update_info_media_detection (Device *device) polling = TRUE; inhibitable = TRUE; + /* custom udev rules might want to disable polling for known-broken + * devices (fdo #26508) */ + if (g_udev_device_has_property (device->priv->d, "UDISKS_DISABLE_POLLING")) + polling = FALSE; + if (device->priv->polling_inhibitors != NULL || daemon_local_has_polling_inhibitors (device->priv->daemon)) { -- 1.6.6.1