bin liu
d387c6edc7
error: introduce thiserror to add path to error message
...
For some cgroup file operations, when failed, add the path
and the value (for write operation) to the error message.
Fixes : #93
Signed-off-by: bin liu <liubin0329@gmail.com >
2022-11-18 17:46:02 +08:00
Dov Murik
0c908cddf8
memory: set_kmem_limit: ignore Unsupported error
...
Setting (writing into) `memory.kmem.limit_in_bytes` is not supported in
Linux kernel >= 5.16 (see kernel commit 58056f77502: "memcg, kmem:
further deprecate kmem.limit_in_bytes"):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58056f77502
If the write call in `set_kmem_limit()` returns EOPNOTSUPP, log a
warning message but ignore the error (do nothing).
Add a unit-test for `set_kmem_limit` in cgroups v1.
Fix #81
Signed-off-by: Dov Murik <dov.murik1@il.ibm.com >
2022-06-27 08:29:40 +00:00
Felix Obenhuber
92122de48d
clippy: Fix clippy version 0.1.60
...
Fix clippy lints from clippy 0.1.60 (7737e0b 2022-04-04).
Signed-off-by: Felix Obenhuber <felix@obenhuber.de >
2022-04-28 16:36:57 +02:00
Jon Magnuson
01475ad515
clippy: fix needless-borrow in test
...
Fix needless-borrow in test.
Signed-off-by: Jon Magnuson <jon.magnuson@gmail.com >
2021-11-11 11:20:49 +08:00
Tim Zhang
ec4cda1dd9
Fix clippy for rust 1.53
...
There are new lints are added in clippy for rust 1.53
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-06-30 19:07:56 +08:00
Tim Zhang
9ec1010a15
Fix clippy warnings
...
Fix clippy warnings.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2021-03-03 13:44:29 +08:00
Jakob Naucke
b9ca0a51f1
Update nix to 0.20.0
...
to pull in https://github.com/nix-rust/nix/pull/1372 and get statfs
MAGIC constants on s390x. Additionally, fork() calls in tests now have
to be marked unsafe.
Fixes : #37
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com >
2021-02-22 14:28:16 +01:00
Tim Zhang
eb6577e3e0
Change package name to cgroups-rs
...
We need a new package name to create a new crate
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-21 15:46:30 +08:00
Tim Zhang
438d774866
Fix test
...
Fix test
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:46 +08:00
Tim Zhang
fbd7164c29
Fix warnings in tests
...
Remove following warnings
- unused import
- unused Result
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:46 +08:00
Tim Zhang
f34225411e
Remove Box wrap of Cgroup.hire
...
It's unnecessary.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:46 +08:00
Tim Zhang
10650e2b16
Update tests to adapt new type of fields in resource
...
The type has been changed to Option type.
Signed-off-by: Tim Zhang <tim@hyper.sh >
2020-12-17 17:56:46 +08:00
bin liu
f8d653e987
cpu: change cfs_quota from u64 to i64
...
cfs_quota can be set to -1 to indicate no limit
Fixes : #5
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-14 13:00:43 +08:00
bin liu
be617190c7
hugetlb: update test to avoid depending on test env
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 17:09:12 +08:00
bin liu
250ada183a
cargo fmt
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 16:42:55 +08:00
bin liu
ff6a0ea82a
add SPDX-License-Identifier for modified files
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 13:35:46 +08:00
bin liu
bcbf438823
Merge remote-tracking branch 'upstream/master'
2020-09-09 13:27:12 +08:00
bin liu
c3912223d0
use let Some() instead of is_some() to make codes clear
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-09 13:26:18 +08:00
bin liu
5d51e50bec
get relative paths at new/load func default.
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-08 10:30:29 +08:00
bin liu
86b245076c
add SPDX-License-Identifier for all source
...
Add SPDX-License-Identifier for all existing codes.
Fixes : #2
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-07 20:29:40 +08:00
bin liu
cd2c748a74
add systemd controller; add more tests; update blkio stat for v2
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-07 14:18:41 +08:00
bin liu
c623dc3fba
add basic v2 cpu/memory functions
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-09-02 22:03:11 +08:00
bin liu
9fe6cb58e4
change *limit* in memory from u64 to i64
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-27 23:06:44 +08:00
bin liu
c702852fd7
add disable oom_control function
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 11:35:01 +08:00
bin liu
9d70467327
add hugetlb functions
...
Signed-off-by: bin liu <bin@hyper.sh >
2020-08-25 10:58:56 +08:00
Levente Kurusa
ed1e8162d5
rust2018: remove extern crate
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-12-23 16:57:41 +01:00
Levente Kurusa
01a3c22829
Transition to Rust 2018
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-12-23 16:31:05 +01:00
Levente Kurusa
b4cc91f977
Builder pattern for control groups
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-10-30 21:47:18 +01:00
Sam Wilson
7826b798bd
Implement ::std::error::Error
2018-10-12 09:49:52 +02:00
Sam Wilson
84ae587360
Replace println! calls with logging
2018-10-12 09:49:52 +02:00
Hidehito Yabuuchi
adc3323be4
Replace '/*' style comments with '//' style, which is recommended officially
2018-10-06 18:05:59 +02:00
Hidehito Yabuuchi
2149e1c0c4
Run rustfmt
2018-10-06 18:05:59 +02:00
Levente Kurusa
af12452fca
tests: cgroup: re-enable the test for moving the task
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-09 16:46:15 +02:00
Levente Kurusa
be5db6ba50
cpuset: fail if trying to enable memory pressure on a non-root cg
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-04 10:45:32 +02:00
Levente Kurusa
19e2847e15
tests: fix broken tests
...
Fixes: c82a94b
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-04 10:03:56 +02:00
Levente Kurusa
ede7201b73
devices: parse files in the devices subsystem
...
Also, a test!
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-04 10:02:54 +02:00
Levente Kurusa
c82a94b58e
tree: add some simple error reporting
...
There's still plenty to wish for.
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-03 00:11:33 +02:00
Levente Kurusa
7c83b7b236
test: cgroup: test moving to the root cg
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-02 15:33:57 +02:00
Levente Kurusa
17b6c2787a
tests: pids: add a proper test
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-09-01 17:07:27 +02:00
Levente Kurusa
367ea556ca
tests: move tests to tests/ directory and give the user cgroup perms
...
Signed-off-by: Levente Kurusa <lkurusa@acm.org >
2018-08-30 13:40:15 +02:00