]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/device.c
core: rework how device units get set up
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Jun 2018 15:28:32 +0000 (17:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Jun 2018 13:29:17 +0000 (15:29 +0200)
commit66f3fdbb073d8263b34bd65982a7e59d09086b23
tree62155e9df194a39e1c87baeaab5dcd4072363dbf
parent69ce73d18d474f3531e52ade69a2a4725466888f
core: rework how device units get set up

This reworks how device units are "powered on".

This makes sure that any device changes that might have happened while
we were restarting/reloading will be noticed properly. For that we'll
now properly serialize/deserialize both the device unit state and the
device "found" flags, and restore these initially in the "coldplug"
phase of the manager deserialization. While enumerating the udev devices
during startup we'll put together a new "found" flags mask, which we'll
the switch to in the "catchup" phase of the manager deserialization,
which follows the "coldplug" phase.

Note that during the "coldplug" phase no unit state change events are
generated, which is different for the "catchall" phase which will do
that. Thus we correctly make sure that the deserialized state won't pull
in new deps, but any device's change while we were reloading would.

Fixes: #8832
Replaces: #8675
src/core/device.c
src/core/device.h