Commit 0d6e3b06 authored by Darren Shepherd's avatar Darren Shepherd Committed by Erik Wilson

Update FindCgroupMountpointAndRoot to be compatible with newer runc

parent 4ce15bb2
...@@ -38,7 +38,7 @@ func GetPids(cgroupPath string) ([]int, error) { ...@@ -38,7 +38,7 @@ func GetPids(cgroupPath string) ([]int, error) {
func getCgroupPath(cgroupPath string) (string, error) { func getCgroupPath(cgroupPath string) (string, error) {
cgroupPath = libcontainerutils.CleanPath(cgroupPath) cgroupPath = libcontainerutils.CleanPath(cgroupPath)
mnt, root, err := libcontainercgroups.FindCgroupMountpointAndRoot("devices") mnt, root, err := libcontainercgroups.FindCgroupMountpointAndRoot(cgroupPath, "devices")
// If we didn't mount the subsystem, there is no point we make the path. // If we didn't mount the subsystem, there is no point we make the path.
if err != nil { if err != nil {
return "", err return "", err
......
...@@ -23,11 +23,11 @@ const ( ...@@ -23,11 +23,11 @@ const (
// https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt // https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
func FindCgroupMountpoint(subsystem string) (string, error) { func FindCgroupMountpoint(subsystem string) (string, error) {
mnt, _, err := FindCgroupMountpointAndRoot(subsystem) mnt, _, err := FindCgroupMountpointAndRoot("", subsystem)
return mnt, err return mnt, err
} }
func FindCgroupMountpointAndRoot(subsystem string) (string, string, error) { func FindCgroupMountpointAndRoot(_, subsystem string) (string, string, error) {
// We are not using mount.GetMounts() because it's super-inefficient, // We are not using mount.GetMounts() because it's super-inefficient,
// parsing it directly sped up x10 times because of not using Sscanf. // parsing it directly sped up x10 times because of not using Sscanf.
// It was one of two major performance drawbacks in container start. // It was one of two major performance drawbacks in container start.
...@@ -257,7 +257,7 @@ func GetInitCgroupPath(subsystem string) (string, error) { ...@@ -257,7 +257,7 @@ func GetInitCgroupPath(subsystem string) (string, error) {
} }
func getCgroupPathHelper(subsystem, cgroup string) (string, error) { func getCgroupPathHelper(subsystem, cgroup string) (string, error) {
mnt, root, err := FindCgroupMountpointAndRoot(subsystem) mnt, root, err := FindCgroupMountpointAndRoot("", subsystem)
if err != nil { if err != nil {
return "", err return "", err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment