diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-01-31 09:48:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 09:48:05 +0100 |
commit | 116ce3f391f61dbdda3b3ae86f1587f677ffd7b5 (patch) | |
tree | 0092fe0b14eba7af0d3748f09d8c2407ca4e93e1 /src/core/unit.h | |
parent | Merge pull request #30968 from poettering/per-user-creds (diff) | |
parent | core: Fail to start/stop/reload unit if frozen (diff) | |
download | systemd-116ce3f391f61dbdda3b3ae86f1587f677ffd7b5.tar.xz systemd-116ce3f391f61dbdda3b3ae86f1587f677ffd7b5.zip |
Merge pull request #31039 from AdrianVovk/slice-freeze-thaw
Rework slice recursive freeze/thaw
Diffstat (limited to 'src/core/unit.h')
-rw-r--r-- | src/core/unit.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/unit.h b/src/core/unit.h index 372791f77e..15103efb64 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -642,9 +642,9 @@ typedef struct UnitVTable { /* Clear out the various runtime/state/cache/logs/configuration data */ int (*clean)(Unit *u, ExecCleanMask m); - /* Freeze the unit */ - int (*freeze)(Unit *u); - int (*thaw)(Unit *u); + /* Freeze or thaw the unit. Returns > 0 to indicate that the request will be handled asynchronously; unit_frozen + * or unit_thawed should be called once the operation is done. Returns 0 if done successfully, or < 0 on error. */ + int (*freezer_action)(Unit *u, FreezerAction a); bool (*can_freeze)(Unit *u); /* Return which kind of data can be cleaned */ @@ -912,7 +912,6 @@ bool unit_has_name(const Unit *u, const char *name); UnitActiveState unit_active_state(Unit *u); FreezerState unit_freezer_state(Unit *u); -int unit_freezer_state_kernel(Unit *u, FreezerState *ret); const char* unit_sub_state_to_string(Unit *u); @@ -1099,15 +1098,11 @@ bool unit_can_stop_refuse_manual(Unit *u); bool unit_can_isolate_refuse_manual(Unit *u); bool unit_can_freeze(Unit *u); -int unit_freeze(Unit *u); +int unit_freezer_action(Unit *u, FreezerAction action); +void unit_next_freezer_state(Unit *u, FreezerAction a, FreezerState *ret, FreezerState *ret_tgt); void unit_frozen(Unit *u); - -int unit_thaw(Unit *u); void unit_thawed(Unit *u); -int unit_freeze_vtable_common(Unit *u); -int unit_thaw_vtable_common(Unit *u); - Condition *unit_find_failed_condition(Unit *u); int unit_arm_timer(Unit *u, sd_event_source **source, bool relative, usec_t usec, sd_event_time_handler_t handler); |