mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
change *limit* in memory from u64 to i64
Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
+10
-2
@@ -23,6 +23,7 @@ pub struct HugeTlbController {
|
||||
base: PathBuf,
|
||||
path: PathBuf,
|
||||
sizes: Vec<String>,
|
||||
v2: bool,
|
||||
}
|
||||
|
||||
impl ControllerInternal for HugeTlbController {
|
||||
@@ -39,6 +40,10 @@ impl ControllerInternal for HugeTlbController {
|
||||
&self.base
|
||||
}
|
||||
|
||||
fn is_v2(&self) -> bool {
|
||||
self.v2
|
||||
}
|
||||
|
||||
fn apply(&self, res: &Resources) -> Result<()> {
|
||||
// get the resources that apply to this controller
|
||||
let res: &HugePageResources = &res.hugepages;
|
||||
@@ -85,14 +90,17 @@ fn read_u64_from(mut file: File) -> Result<u64> {
|
||||
|
||||
impl HugeTlbController {
|
||||
/// Constructs a new `HugeTlbController` with `oroot` serving as the root of the control group.
|
||||
pub fn new(oroot: PathBuf) -> Self {
|
||||
pub fn new(oroot: PathBuf, v2: bool) -> Self {
|
||||
let mut root = oroot;
|
||||
root.push(Self::controller_type().to_string());
|
||||
if !v2 {
|
||||
root.push(Self::controller_type().to_string());
|
||||
}
|
||||
let sizes = get_hugepage_sizes().unwrap();
|
||||
Self {
|
||||
base: root.clone(),
|
||||
path: root,
|
||||
sizes: sizes,
|
||||
v2: v2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user