diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-05-26 16:09:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-05-26 21:44:36 +0200 |
commit | b485fd932ad37a945569857127b7e929e87e17b2 (patch) | |
tree | 3f87e0633ba6446202bbf1bbace37d8dcf788bc9 /src/systemd/sd-device.h | |
parent | 6f7530929538b28cb41c289ad9cbced51848fc02 (diff) | |
download | systemd-b485fd932ad37a945569857127b7e929e87e17b2.tar.gz |
sd-device: add API for triggering synthetic uevents with UUID
Since kernel 4.13 the kerne allows passing a UUID to generated uevents.
Optionally do so via a new sd_device_trigger_with_uuid() call, and add
sd_device_get_trigger_uuid() as helper to retrieve the UUID from a
uevent we receive.
This is useful for tracking uevents through the udev system, and waiting
for specific triggers.
(Note that the 4.13 patch allows passing arbitrary meta-info into the
uevent as well. This does not add an API for that, because I am not
convinced it makes sense — as it conflicts with our general rule that
events are "stateless" if you so will — and it complicates the interface
quite a bit).
This replaces #13881 in a way, which added a similar infra, but which
stalled, and whose synchronous settling APIs are somewhat problematic
and probably not material to merge.
Diffstat (limited to 'src/systemd/sd-device.h')
-rw-r--r-- | src/systemd/sd-device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h index 8b7b361295..04599ea382 100644 --- a/src/systemd/sd-device.h +++ b/src/systemd/sd-device.h @@ -24,6 +24,7 @@ #include <sys/types.h> #include "sd-event.h" +#include "sd-id128.h" #include "_sd-common.h" @@ -96,11 +97,13 @@ const char *sd_device_get_sysattr_next(sd_device *device); int sd_device_has_tag(sd_device *device, const char *tag); int sd_device_has_current_tag(sd_device *device, const char *tag); int sd_device_get_property_value(sd_device *device, const char *key, const char **value); +int sd_device_get_trigger_uuid(sd_device *device, sd_id128_t *ret); int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const char **_value); int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, const char *value); int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr, const char *format, ...) _sd_printf_(3, 4); int sd_device_trigger(sd_device *device, sd_device_action_t action); +int sd_device_trigger_with_uuid(sd_device *device, sd_device_action_t action, sd_id128_t *ret_uuid); /* device enumerator */ |