]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: kill monitor_full_path
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 23:38:47 +0000 (00:38 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 23:39:22 +0000 (00:39 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.h

index d1db8f0fb87fa30365a5a1bf6cc556874fdbbd92..7b4a0b4a679af50a5350c04dfb0091b28884f0df 100644 (file)
@@ -1172,7 +1172,6 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
                        h->container_limit_path = h->container_full_path;
        } else {
                h->cgfd_mon = move_fd(fd_final);
-               h->monitor_full_path = move_ptr(path);
        }
 
        return true;
@@ -1199,7 +1198,6 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
                if (h->cgfd_mon < 0)
                        prune = false;
 
-               free_disarm(h->monitor_full_path);
                close_prot_errno_disarm(h->cgfd_mon);
        }
 
@@ -1386,7 +1384,7 @@ __cgfsng_ops static bool cgfsng_monitor_create(struct cgroup_ops *ops, struct lx
                                               monitor_cgroup, NULL, false))
                                continue;
 
-                       DEBUG("Failed to create cgroup \"%s\"", maybe_empty(ops->hierarchies[i]->monitor_full_path));
+                       DEBUG("Failed to create cgroup %s)", monitor_cgroup);
                        for (int j = 0; j <= i; j++)
                                cgroup_tree_prune_leaf(ops->hierarchies[j],
                                                       monitor_cgroup, false);
@@ -1548,18 +1546,18 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
 
                ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", monitor, monitor_len);
                if (ret)
-                       return log_error_errno(false, errno, "Failed to enter cgroup \"%s\"", h->monitor_full_path);
+                       return log_error_errno(false, errno, "Failed to enter cgroup %d", h->cgfd_mon);
 
-               TRACE("Moved monitor into %s cgroup via %d", h->monitor_full_path, h->cgfd_mon);
+               TRACE("Moved monitor into cgroup %d", h->cgfd_mon);
 
                if (handler->transient_pid <= 0)
                        continue;
 
                ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", transient, transient_len);
                if (ret)
-                       return log_error_errno(false, errno, "Failed to enter cgroup \"%s\"", h->monitor_full_path);
+                       return log_error_errno(false, errno, "Failed to enter cgroup %d", h->cgfd_mon);
 
-               TRACE("Moved transient process into %s cgroup via %d", h->monitor_full_path, h->cgfd_mon);
+               TRACE("Moved transient process into cgroup %d", h->cgfd_mon);
 
                /*
                 * we don't keep the fds for non-unified hierarchies around
index 7a620a190046d6497b8e1de2d62166b4072f46b8..c4a3afe86c73b3f8d3298386577a31bc03720360 100644 (file)
@@ -62,9 +62,6 @@ typedef enum {
  * - The full path to the container's limiting cgroup. May simply point to
  *   container_full_path.
  *
- * @monitor_full_path
- * - The full path to the monitor's cgroup.
- *
  * @version
  * - legacy hierarchy
  *   If the hierarchy is a legacy hierarchy this will be set to
@@ -84,7 +81,6 @@ struct hierarchy {
        char *container_base_path;
        char *container_full_path;
        char *container_limit_path;
-       char *monitor_full_path;
        int version;
 
        /* cgroup2 only */
@@ -101,7 +97,7 @@ struct hierarchy {
         */
        int cgfd_limit;
 
-       /* File descriptor for the monitor's cgroup @monitor_full_path. */
+       /* File descriptor for the monitor's cgroup. */
        int cgfd_mon;
 
        /* File descriptor for the controller's mountpoint @mountpoint. */