Skip to content

Commit 97162af

Browse files
committed
Add back cgroups.AddPid
This reverts commit cce5ec8 and calls .Apply to honor the API. Note: This has already gone through a revert and re-revert cycle in commits 5273685 and 3fe402b, but that's wrong per: containers/podman#27551 (comment) . Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
1 parent 9b89bf9 commit 97162af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

common/pkg/cgroups/cgroups_linux.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,15 @@ func (c *CgroupControl) Update(resources *cgroups.Resources) error {
298298
return man.Set(resources)
299299
}
300300

301+
// AddPid moves the specified pid to the cgroup.
302+
func (c *CgroupControl) AddPid(pid int) error {
303+
man, err := fs2.NewManager(c.config, filepath.Join(cgroupRoot, c.config.Path))
304+
if err != nil {
305+
return err
306+
}
307+
return man.Apply(pid)
308+
}
309+
301310
// Stat returns usage statistics for the cgroup.
302311
func (c *CgroupControl) Stat() (*cgroups.Stats, error) {
303312
m := cgroups.Stats{}

0 commit comments

Comments
 (0)