if (!new)
return ret_errno(ENOMEM);
- new->cgfd_con = -EBADF;
- new->cgfd_limit = -EBADF;
- new->cgfd_mon = -EBADF;
+ new->cgfd_con = -EBADF;
+ new->cgfd_limit = -EBADF;
+ new->cgfd_mon = -EBADF;
- new->fs_type = fs_type;
- new->controllers = controllers;
- new->mountpoint = mnt;
- new->container_base_path = base_cgroup;
+ new->fs_type = fs_type;
+ new->controllers = controllers;
+ new->mountpoint = mnt;
+ new->at_base = base_cgroup;
- new->dfd_mnt = dfd_mnt;
- new->dfd_base = dfd_base;
+ new->dfd_mnt = dfd_mnt;
+ new->dfd_base = dfd_base;
TRACE("Adding cgroup hierarchy mounted at %s and base cgroup %s",
mnt, maybe_empty(base_cgroup));
!ops->setup_limits_legacy(ops, conf, true))
return log_error(false, "Failed to setup legacy device limits");
- limit_path = make_cgroup_path(h, h->container_base_path, cgroup_limit_dir, NULL);
+ limit_path = make_cgroup_path(h, h->at_base, cgroup_limit_dir, NULL);
path = must_make_path(limit_path, cgroup_leaf, NULL);
/*
TRACE("Removed cgroup tree %d(%s)", h->dfd_base, cgroup_limit_dir);
}
} else {
- path = make_cgroup_path(h, h->container_base_path, cgroup_limit_dir, NULL);
+ path = make_cgroup_path(h, h->at_base, cgroup_limit_dir, NULL);
fd_final = __cgroup_tree_create(h->dfd_base, cgroup_limit_dir, 0755, cpuset_v1, false);
}
INFO("Remounted %s read-only", hierarchy_mnt);
}
- sourcepath = make_cgroup_path(h, h->container_base_path, container_cgroup, NULL);
+ sourcepath = make_cgroup_path(h, h->at_base, container_cgroup, NULL);
if (cgroup_automount_type == LXC_AUTO_CGROUP_RO)
flags |= MS_RDONLY;
cgroup_root = must_make_path(rootfs_mnt, DEFAULT_CGROUP_MOUNTPOINT, NULL);
hierarchy_mnt = must_make_path(cgroup_root, h->mountpoint, NULL);
- path2 = must_make_path(hierarchy_mnt, h->container_base_path,
+ path2 = must_make_path(hierarchy_mnt, h->at_base,
ops->container_cgroup, NULL);
ret = mkdir_p(path2, 0755);
if (ret < 0 && (errno != EEXIST))
int ret;
fullpath = make_cgroup_path(ops->hierarchies[i],
- ops->hierarchies[i]->container_base_path,
+ ops->hierarchies[i]->at_base,
"cgroup.procs", NULL);
ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
if (ret != 0)
* depending on whether this is a hybrid cgroup layout (mix of legacy and
* unified hierarchies) or a pure unified cgroup layout.
*
- * @container_base_path
+ * @at_base
* - 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).
char **cgroup2_chown;
char **controllers;
char *mountpoint;
- char *container_base_path;
char *container_full_path;
char *container_limit_path;
cgroupfs_type_magic_t fs_type;
/* File descriptor for the controller's mountpoint @mountpoint. */
int dfd_mnt;
- /* File descriptor for the controller's base cgroup path @container_base_path. */
+ /* File descriptor for the controller's base cgroup path @at_base. */
int dfd_base;
+ char *at_base;
};
struct cgroup_ops {