summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/libsystemd.sym
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-12-13 17:55:14 +0100
committerLennart Poettering <lennart@poettering.net>2020-09-01 17:40:12 +0200
commite77b146f825ef1bb63c297cc713962b94422d2c6 (patch)
tree1bec641d532da62e231831d93b2ef7966720cea5 /src/libsystemd/libsystemd.sym
parenttest-functions: make sure we test our own libudev instead of the host libudev (diff)
downloadsystemd-e77b146f825ef1bb63c297cc713962b94422d2c6.tar.xz
systemd-e77b146f825ef1bb63c297cc713962b94422d2c6.zip
udev: make tags "sticky"
This tries to address the "bind"/"unbind" uevent kernel API breakage, by changing the semantics of device tags. Previously, tags would be applied on uevents (and the database entries they result in) only depending on the immediate context. This means that if one uevent causes the tag to be set and the next to be unset, this would immediately effect what apps would see and the database entries would contain each time. This is problematic however, as tags are a filtering concept, and if tags vanish then clients won't hence notice when a device stops being relevant to them since not only the tags disappear but immediately also the uevents for it are filtered including the one necessary for the app to notice that the device lost its tag and hence relevance. With this change tags become "sticky". If a tag is applied is once applied to a device it will stay in place forever, until the device is removed. Tags can never be removed again. This means that an app watching a specific set of devices by filtering for a tag is guaranteed to not only see the events where the tag is set but also all follow-up events where the tags might be removed again. This change of behaviour is unfortunate, but is required due to the kernel introducing new "bind" and "unbind" uevents that generally have the effect that tags and properties disappear and apps hence don't notice when a device looses relevance to it. "bind"/"unbind" events were introduced in kernel 4.12, and are now used in more and more subsystems. The introduction broke userspace widely, and this commit is an attempt to provide a way for apps to deal with it. While tags are now "sticky" a new automatic device property CURRENT_TAGS is introduced (matching the existing TAGS property) that always reflects the precise set of tags applied on the most recent events. Thus, when subscribing to devices through tags, all devices that ever had the tag put on them will be be seen, and by CURRENT_TAGS it may be checked whether the device right at the moment matches the tag requirements. See: #7587 #7018 #8221
Diffstat (limited to 'src/libsystemd/libsystemd.sym')
-rw-r--r--src/libsystemd/libsystemd.sym4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
index a3659d00b3..1bee5318d6 100644
--- a/src/libsystemd/libsystemd.sym
+++ b/src/libsystemd/libsystemd.sym
@@ -728,4 +728,8 @@ global:
sd_event_source_set_time_relative;
sd_bus_error_has_names_sentinel;
+
+ sd_device_get_current_tag_first;
+ sd_device_get_current_tag_next;
+ sd_device_has_current_tag;
} LIBSYSTEMD_246;