pkg/cgroups: Export ParseCgroupFile

This is needed for the libvirt exec driver.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
This commit is contained in:
Alexander Larsson
2014-09-22 18:01:58 +02:00
committed by Cédric Bosdonnat
parent 2dce757d21
commit 06949e779f
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ const (
func TestParseCgroups(t *testing.T) {
r := bytes.NewBuffer([]byte(cgroupsContents))
_, err := parseCgroupFile("blkio", r)
_, err := ParseCgroupFile("blkio", r)
if err != nil {
t.Fatal(err)
}
+3 -3
View File
@@ -115,7 +115,7 @@ func GetThisCgroupDir(subsystem string) (string, error) {
}
defer f.Close()
return parseCgroupFile(subsystem, f)
return ParseCgroupFile(subsystem, f)
}
func GetInitCgroupDir(subsystem string) (string, error) {
@@ -125,7 +125,7 @@ func GetInitCgroupDir(subsystem string) (string, error) {
}
defer f.Close()
return parseCgroupFile(subsystem, f)
return ParseCgroupFile(subsystem, f)
}
func ReadProcsFile(dir string) ([]int, error) {
@@ -152,7 +152,7 @@ func ReadProcsFile(dir string) ([]int, error) {
return out, nil
}
func parseCgroupFile(subsystem string, r io.Reader) (string, error) {
func ParseCgroupFile(subsystem string, r io.Reader) (string, error) {
s := bufio.NewScanner(r)
for s.Scan() {