mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Builder pattern for control groups
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
This commit is contained in:
+1
-1
@@ -131,7 +131,7 @@ impl HugeTlbController {
|
||||
/// Set the limit (in bytes) of how much memory can be backed by hugepages of a certain size
|
||||
/// (`hugetlb_size`).
|
||||
pub fn set_limit_in_bytes(&self, hugetlb_size: &String, limit: u64) -> Result<()> {
|
||||
self.open_path(&format!("hugetlb.{}.limit_in_bytes", hugetlb_size), false)
|
||||
self.open_path(&format!("hugetlb.{}.limit_in_bytes", hugetlb_size), true)
|
||||
.and_then(|mut file| {
|
||||
file.write_all(limit.to_string().as_ref())
|
||||
.map_err(|e| Error::with_cause(WriteFailed, e))
|
||||
|
||||
Reference in New Issue
Block a user