cgroups: get controllers on the unified hierarchy

parent 2ddc6653
......@@ -33,6 +33,13 @@ struct lxc_conf;
struct lxc_list;
typedef enum {
CGROUP_LAYOUT_UNKNOWN = -1,
CGROUP_LAYOUT_LEGACY = 0,
CGROUP_LAYOUT_HYBRID = 1,
CGROUP_LAYOUT_UNIFIED = 2,
} cgroup_layout_t;
typedef enum {
CGFS,
CGMANAGER,
CGFSNG,
......
......@@ -35,12 +35,12 @@
int get_cgroup_version(char *line)
{
if (is_cgroupfs_v1(line))
return CGROUP_V1;
return CGROUP_SUPER_MAGIC;
if (is_cgroupfs_v2(line))
return CGROUP_V2;
return CGROUP2_SUPER_MAGIC;
return -1;
return 0;
}
bool is_cgroupfs_v1(char *line)
......
......@@ -28,10 +28,6 @@
#include <stdbool.h>
#include <stdio.h>
#define CGROUP_V1 0
#define CGROUP_V2 1
#define LXCFS_CGROUP 2
/* Retrieve the cgroup version of a given entry from /proc/<pid>/mountinfo. */
extern int get_cgroup_version(char *line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment