summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-16 04:36:06 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-16 04:41:21 +0200
commit7027ff61a34a12487712b382a061c654acc3a679 (patch)
tree05e9374a566d6accdd962dd4dc6d7076b9304122 /src/shared/cgroup-util.h
parentcec4ead904978b07db2154c618eeb48d3102da66 (diff)
nspawn: introduce the new /machine/ tree in the cgroup tree and move containers there
Containers will now carry a label (normally derived from the root directory name, but configurable by the user), and the container's root cgroup is /machine/<label>. This label is called "machine name", and can cover both containers and VMs (as soon as libvirt also makes use of /machine/). libsystemd-login can be used to query the machine name from a process. This patch also includes numerous clean-ups for the cgroup code.
Diffstat (limited to 'src/shared/cgroup-util.h')
-rw-r--r--src/shared/cgroup-util.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h
index 274380aa2d..5457d1bcaa 100644
--- a/src/shared/cgroup-util.h
+++ b/src/shared/cgroup-util.h
@@ -44,11 +44,12 @@ int cg_migrate_recursive(const char *cfrom, const char *pfrom, const char *cto,
int cg_split_spec(const char *spec, char **controller, char **path);
int cg_join_spec(const char *controller, const char *path, char **spec);
-int cg_fix_path(const char *path, char **result);
+int cg_mangle_path(const char *path, char **result);
int cg_get_path(const char *controller, const char *path, const char *suffix, char **fs);
int cg_get_path_and_check(const char *controller, const char *path, const char *suffix, char **fs);
-int cg_get_by_pid(const char *controller, pid_t pid, char **path);
+
+int cg_pid_get_path(const char *controller, pid_t pid, char **path);
int cg_trim(const char *controller, const char *path, bool delete_root);
@@ -68,16 +69,24 @@ int cg_is_empty(const char *controller, const char *path, bool ignore_self);
int cg_is_empty_by_spec(const char *spec, bool ignore_self);
int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self);
+int cg_get_root_path(char **path);
+int cg_get_system_path(char **path);
int cg_get_user_path(char **path);
+int cg_get_machine_path(char **path);
+int cg_path_get_session(const char *path, char **session);
int cg_path_get_unit(const char *path, char **unit);
int cg_path_get_user_unit(const char *path, char **unit);
+int cg_path_get_machine_name(const char *path, char **machine);
+
+int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup);
-int cg_pid_get_cgroup(pid_t pid, char **root, char **cgroup);
+int cg_pid_get_session(pid_t pid, char **session);
int cg_pid_get_unit(pid_t pid, char **unit);
int cg_pid_get_user_unit(pid_t pid, char **unit);
+int cg_pid_get_machine_name(pid_t pid, char **machine);
-int cg_cgroup_to_unit(const char *cgroup, char **unit);
+int cg_path_decode_unit(const char *cgroup, char **unit);
char **cg_shorten_controllers(char **controllers);