]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: s/base_cgroup/container_base_path/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Sep 2018 13:47:59 +0000 (15:47 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 21 Sep 2018 14:47:04 +0000 (16:47 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.c
src/lxc/cgroups/cgroup.h

index ddecceaa5b119dce0873468d270a10ac33404462..835a881c1670abd141b23b0a03aac75e7e820ca6 100644 (file)
@@ -573,7 +573,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
        if (slash)
                *slash = '\0';
 
-       cgpath = must_make_path(h->mountpoint, h->base_cgroup, cgname, NULL);
+       cgpath = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL);
        if (slash)
                *slash = '/';
 
@@ -810,7 +810,7 @@ static char **cg_unified_get_controllers(const char *file)
 }
 
 static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char *mountpoint,
-                                      char *base_cgroup, int type)
+                                      char *container_base_path, int type)
 {
        struct hierarchy *new;
        int newentry;
@@ -818,7 +818,7 @@ static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char
        new = must_alloc(sizeof(*new));
        new->controllers = clist;
        new->mountpoint = mountpoint;
-       new->base_cgroup = base_cgroup;
+       new->container_base_path = container_base_path;
        new->container_full_path = NULL;
        new->version = type;
 
@@ -1015,7 +1015,7 @@ static void lxc_cgfsng_print_hierarchies(struct cgroup_ops *ops)
                int j;
                char **cit;
 
-               TRACE("  %d: base_cgroup: %s", i, (*it)->base_cgroup ? (*it)->base_cgroup : "(null)");
+               TRACE("  %d: base_cgroup: %s", i, (*it)->container_base_path ? (*it)->container_base_path : "(null)");
                TRACE("      mountpoint:  %s", (*it)->mountpoint ? (*it)->mountpoint : "(null)");
                TRACE("      controllers:");
                for (j = 0, cit = (*it)->controllers; cit && *cit; cit++, j++)
@@ -1167,7 +1167,7 @@ static bool cg_unified_create_cgroup(struct hierarchy *h, char *cgname)
        if (parts_len > 0)
                parts_len--;
 
-       cgroup = must_make_path(h->mountpoint, h->base_cgroup, NULL);
+       cgroup = must_make_path(h->mountpoint, h->container_base_path, NULL);
        for (i = 0; i < parts_len; i++) {
                int ret;
                char *target;
@@ -1196,7 +1196,7 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname)
 {
        int ret;
 
-       h->container_full_path = must_make_path(h->mountpoint, h->base_cgroup, cgname, NULL);
+       h->container_full_path = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL);
        if (dir_exists(h->container_full_path)) {
                ERROR("The cgroup \"%s\" already existed", h->container_full_path);
                return false;
@@ -1498,7 +1498,7 @@ static int cg_legacy_mount_controllers(int type, struct hierarchy *h,
                INFO("Remounted %s read-only", controllerpath);
        }
 
-       sourcepath = must_make_path(h->mountpoint, h->base_cgroup,
+       sourcepath = must_make_path(h->mountpoint, h->container_base_path,
                                    container_cgroup, NULL);
        if (type == LXC_AUTO_CGROUP_RO)
                flags |= MS_RDONLY;
@@ -1669,7 +1669,7 @@ __cgfsng_ops__ static bool cgfsng_mount(struct cgroup_ops *ops,
                        continue;
                }
 
-               path2 = must_make_path(controllerpath, h->base_cgroup,
+               path2 = must_make_path(controllerpath, h->container_base_path,
                                       ops->container_cgroup, NULL);
                ret = mkdir_p(path2, 0755);
                if (ret < 0) {
@@ -1762,7 +1762,7 @@ __cgfsng_ops__ static bool cgfsng_escape(const struct cgroup_ops *ops,
                char *fullpath;
 
                fullpath = must_make_path(ops->hierarchies[i]->mountpoint,
-                                         ops->hierarchies[i]->base_cgroup,
+                                         ops->hierarchies[i]->container_base_path,
                                          "cgroup.procs", NULL);
                ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
                if (ret != 0) {
index 5c6523bc9d008a1cfcb4d91a5016a5f92f2fd207..517bb4b3cc610a631f173ce7fe1d25b58cad6153 100644 (file)
@@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops)
                free((*it)->controllers);
 
                free((*it)->mountpoint);
-               free((*it)->base_cgroup);
+               free((*it)->container_base_path);
                free((*it)->container_full_path);
                free(*it);
        }
index 4c1e94c231f6055e1eedbaf65d150265e3a821c4..9aba1842b99d6419cee56e3c3e3366c3a2da9a29 100644 (file)
@@ -57,7 +57,7 @@ typedef enum {
  *   depending on whether this is a hybrid cgroup layout (mix of legacy and
  *   unified hierarchies) or a pure unified cgroup layout.
  *
- * @base_cgroup
+ * @container_base_path
  * - The cgroup under which the container cgroup path
  *   is created. This will be either the caller's cgroup (if not root), or
  *   init's cgroup (if root).
@@ -76,7 +76,7 @@ typedef enum {
 struct hierarchy {
        char **controllers;
        char *mountpoint;
-       char *base_cgroup;
+       char *container_base_path;
        char *container_full_path;
        int version;
 };