From f62009410a72f5a89bfb8fdd7e48d9d472a6887b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 Apr 2015 12:29:05 +0200 Subject: device: rework how we enter tentative state This reworks how we enter tentative state and does so only when a device was previously not announced via udev. The previous check actually just checked whether a new state bit was set, which is not correct. Also, to be able to reliably maintain the tentative state across daemon reloads, we need to serialize and deserialize it. --- src/core/device.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/device.h') diff --git a/src/core/device.h b/src/core/device.h index 9f46e08953..10ab113176 100644 --- a/src/core/device.h +++ b/src/core/device.h @@ -23,7 +23,6 @@ typedef struct Device Device; - /* We simply watch devices, we cannot plug/unplug them. That * simplifies the state engine greatly */ typedef enum DeviceState { @@ -52,7 +51,7 @@ struct Device { devices for the same sysfs path. We chain them up here. */ LIST_FIELDS(struct Device, same_sysfs); - DeviceState state; + DeviceState state, deserialized_state; }; extern const UnitVTable device_vtable; -- cgit v1.2.3-54-g00ecf