controllers: verify that resource application went ok or not

Signed-off-by: Levente Kurusa <lkurusa@acm.org>
This commit is contained in:
Levente Kurusa
2018-09-14 15:59:29 +02:00
parent af12452fca
commit 0e350463a1
15 changed files with 98 additions and 24 deletions
+3 -1
View File
@@ -121,7 +121,7 @@ impl Controller for MemController {
fn get_path_mut<'a>(self: &'a mut Self) -> &'a mut PathBuf { &mut self.path }
fn get_base<'a>(self: &'a Self) -> &'a PathBuf { &self.base }
fn apply(self: &Self, res: &Resources) {
fn apply(self: &Self, res: &Resources) -> Result<(), CgroupError> {
/* get the resources that apply to this controller */
let memres: &MemoryResources = &res.memory;
@@ -133,6 +133,8 @@ impl Controller for MemController {
let _ = self.set_tcp_limit(memres.kernel_tcp_memory_limit);
let _ = self.set_swappiness(memres.swappiness);
}
Ok(())
}
}