diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-11-18 00:42:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-11-18 00:42:35 +0100 |
commit | 06d4c99ab3d479c1a7c087a87e82fe01626128f6 (patch) | |
tree | a0216fb2aaf68604a1c8198d0fdee742f43abaff /src/manager.c | |
parent | 7838dc3ae1297d37c2a75a48f429bb415c1eed22 (diff) |
manager: make list of default controllers configurable
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 19 |
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" |