]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroup: drop cgroup_canonical_path
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 14 Sep 2016 14:58:38 +0000 (14:58 +0000)
committerTycho Andersen <tycho.andersen@canonical.com>
Fri, 16 Sep 2016 21:19:19 +0000 (15:19 -0600)
This is almost never the right thing to use, and we don't use it any more
anyway.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/cgroups/cgfs.c
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgmanager.c
src/lxc/cgroups/cgroup.c
src/lxc/cgroups/cgroup.h

index 80a336db9248c6f9caf67544e4e21441fafc2d85..c5ba765fc460f6f625696a3d8d2031f4e1d7b3f0 100644 (file)
@@ -2363,28 +2363,6 @@ static const char *cgfs_get_cgroup(void *hdata, const char *subsystem)
        return lxc_cgroup_get_hierarchy_path_data(subsystem, d);
 }
 
-static const char *cgfs_canonical_path(void *hdata)
-{
-       struct cgfs_data *d = hdata;
-       struct cgroup_process_info *info_ptr;
-       char *path = NULL;
-
-       if (!d)
-               return NULL;
-
-       for (info_ptr = d->info; info_ptr; info_ptr = info_ptr->next) {
-               if (!path)
-                       path = info_ptr->cgroup_path;
-               else if (strcmp(path, info_ptr->cgroup_path) != 0) {
-                       ERROR("not all paths match %s, %s has path %s", path,
-                               info_ptr->hierarchy->subsystems[0], info_ptr->cgroup_path);
-                       return NULL;
-               }
-       }
-
-       return path;
-}
-
 static bool cgfs_escape(void *hdata)
 {
        struct cgroup_meta_data *md;
@@ -2637,7 +2615,6 @@ static struct cgroup_ops cgfs_ops = {
        .enter = cgfs_enter,
        .create_legacy = cgfs_create_legacy,
        .get_cgroup = cgfs_get_cgroup,
-       .canonical_path = cgfs_canonical_path,
        .escape = cgfs_escape,
        .num_hierarchies = cgfs_num_hierarchies,
        .get_hierarchies = cgfs_get_hierarchies,
index 0777bf39aa282e9d2bafb4d65a61103bed77363e..ec940995f000405665a9828015115af0ad70dd86 100644 (file)
@@ -1087,13 +1087,6 @@ out_free:
        return false;
 }
 
-static const char *cgfsng_canonical_path(void *hdata)
-{
-       struct cgfsng_handler_data *d = hdata;
-
-       return d->container_cgroup;
-}
-
 static bool cgfsng_enter(void *hdata, pid_t pid)
 {
        char pidstr[25];
@@ -1686,7 +1679,6 @@ static struct cgroup_ops cgfsng_ops = {
        .destroy = cgfsng_destroy,
        .create = cgfsng_create,
        .enter = cgfsng_enter,
-       .canonical_path = cgfsng_canonical_path,
        .escape = cgfsng_escape,
        .num_hierarchies = cgfsng_num_hierarchies,
        .get_hierarchies = cgfsng_get_hierarchies,
index f14eb1764b6712d6082ac3b00beff4eb70a4c967..f2756b07fbe2cc5ce06e5d043b5881b9d02bdb95 100644 (file)
@@ -746,15 +746,6 @@ static const char *cgm_get_cgroup(void *hdata, const char *subsystem)
        return d->cgroup_path;
 }
 
-static const char *cgm_canonical_path(void *hdata)
-{
-       struct cgm_data *d = hdata;
-
-       if (!d || !d->cgroup_path)
-               return NULL;
-       return d->cgroup_path;
-}
-
 #if HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC
 static inline bool abs_cgroup_supported(void) {
        return api_version >= CGM_SUPPORTS_GET_ABS;
@@ -1667,7 +1658,6 @@ static struct cgroup_ops cgmanager_ops = {
        .enter = cgm_enter,
        .create_legacy = NULL,
        .get_cgroup = cgm_get_cgroup,
-       .canonical_path = cgm_canonical_path,
        .escape = cgm_escape,
        .num_hierarchies = cgm_num_hierarchies,
        .get_hierarchies = cgm_get_hierarchies,
index 48cd403ba61430b9c5b1699bfa251db4eb04a175..78472d4fc28fc92c4efdf6d2ec4fa7950d09fa02 100644 (file)
@@ -119,19 +119,6 @@ bool cgroup_escape(struct lxc_handler *handler)
        return false;
 }
 
-const char *cgroup_canonical_path(struct lxc_handler *handler)
-{
-       if (geteuid()) {
-               WARN("cgroup_canonical_path only makes sense for privileged containers.\n");
-               return NULL;
-       }
-
-       if (ops)
-               return ops->canonical_path(handler->cgroup_data);
-
-       return NULL;
-}
-
 int cgroup_num_hierarchies(void)
 {
        if (!ops)
index f65cbfe49de4f81ff5fe1a168596f28fe778e780..11b251e698edb0f2ea0f8c8890d26cb56e4fbf8b 100644 (file)
@@ -47,7 +47,6 @@ struct cgroup_ops {
        bool (*enter)(void *hdata, pid_t pid);
        bool (*create_legacy)(void *hdata, pid_t pid);
        const char *(*get_cgroup)(void *hdata, const char *subsystem);
-       const char *(*canonical_path)(void *hdata);
        bool (*escape)();
        int (*num_hierarchies)();
        bool (*get_hierarchies)(int n, char ***out);
@@ -78,11 +77,6 @@ extern const char *cgroup_get_cgroup(struct lxc_handler *handler, const char *su
 extern bool cgroup_escape();
 extern int cgroup_num_hierarchies();
 extern bool cgroup_get_hierarchies(int i, char ***out);
-
-/*
- * Currently, this call  only makes sense for privileged containers.
- */
-extern const char *cgroup_canonical_path(struct lxc_handler *handler);
 extern bool cgroup_unfreeze(struct lxc_handler *handler);
 extern void cgroup_disconnect(void);
 extern cgroup_driver_t cgroup_driver(void);