summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index 827e9937c6..62847061a2 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -222,6 +222,9 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
if (!(m->environment = strv_copy(environ)))
goto fail;
+ if (!(m->default_controllers = strv_new("cpu", NULL)))
+ goto fail;
+
if (!(m->units = hashmap_new(string_hash_func, string_compare_func)))
goto fail;
@@ -461,6 +464,8 @@ void manager_free(Manager *m) {
lookup_paths_free(&m->lookup_paths);
strv_free(m->environment);
+ strv_free(m->default_controllers);
+
hashmap_free(m->cgroup_bondings);
set_free_free(m->unit_path_cache);
@@ -2988,6 +2993,20 @@ void manager_undo_generators(Manager *m) {
m->generator_unit_path = NULL;
}
+int manager_set_default_controllers(Manager *m, char **controllers) {
+ char **l;
+
+ assert(m);
+
+ if (!(l = strv_copy(controllers)))
+ return -ENOMEM;
+
+ strv_free(m->default_controllers);
+ m->default_controllers = l;
+
+ return 0;
+}
+
static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = {
[MANAGER_SYSTEM] = "system",
[MANAGER_USER] = "user"