Commit Graph

7 Commits

Author SHA1 Message Date
Piotr Wagner ab27e12ceb Implement GetStat for cpuset cgroup.
Co-authored-by: Piotr Wagner <piotr.wagner@intel.com>
Signed-off-by: Paweł Szulik <pawel.szulik@intel.com>
2021-01-19 18:02:11 +01:00
Sebastiaan van Stijn b3a8b0742c libcontainer: prefer bytes.TrimSpace() over strings.TrimSpace()
Perform trimming before converting to a string, which should be
somewhat more performant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-01 18:36:53 +02:00
Kir Kolyshkin 6c83d23ffc libcontainer/cgroups/fscommon: improve doc
Document ReadFile and WriteFile. Fix doc for ParseUint to be in
canonical form.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-29 11:58:14 -07:00
Kir Kolyshkin 31f0f5b7e0 libct/cg/fscommon.GetCgroupParamUint: improve
1. Use GetCgroupParamString as the initial part of both functions are
   the same and we can reuse it. This also gives us whatever security
   measures GetCgroupParamString has (see previous commit).

2. Fix the error wrapping to not add the value, as it is already a part
   of the error returned by ParseUint.

3. Improve docstring.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-29 11:58:14 -07:00
Kir Kolyshkin e76ac1c054 libct/cg/fscommon.GetCgroupParamString: use ReadFile
1. Use own ReadFile wrapper instead of ioutils.ReadFile.
   This makes it use the security measures of ReadFile.

2. Improve doc.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-29 11:58:14 -07:00
Kir Kolyshkin aac4d1f5c3 libct/cg/fscommon/GetCgroupParamKeyValue: nits
2. Fix wrapping the error to not have the value as it's already
   part of the error returned from ParseUint.

3. Fix/improve doc.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-09-29 11:57:49 -07:00
Akihiro Suda 88e8350de2 cgroup2: split fs2 from fs
split fs2 package from fs, as mixing up fs and fs2 is very likely to result in
unmaintainable code.

Inspired by containerd/cgroups#109

Fix #2157

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-12-06 15:42:10 +09:00