diff --git a/src/libs/kata-types/Cargo.toml b/src/libs/kata-types/Cargo.toml index ecd86cec4..2879dc5a2 100644 --- a/src/libs/kata-types/Cargo.toml +++ b/src/libs/kata-types/Cargo.toml @@ -26,7 +26,7 @@ serde_json = "1.0.73" thiserror = "1.0" toml = "0.5.8" serde-enum-str = "0.4" -sysinfo = "0.30.5" +sysinfo = "0.34.2" oci-spec = { version = "0.6.8", features = ["runtime"] } safe-path = { path = "../safe-path" } diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index c9a1487fc..ef7d9773d 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -33,7 +33,7 @@ use std::collections::HashMap; use std::io::{self, Result}; use std::path::Path; use std::sync::{Arc, Mutex}; -use sysinfo::System; +use sysinfo::{MemoryRefreshKind, RefreshKind, System}; mod dragonball; pub use self::dragonball::{DragonballConfig, HYPERVISOR_NAME_DRAGONBALL}; @@ -751,7 +751,9 @@ impl MemoryInfo { "Memory backend file {} is invalid: {}" )?; if self.default_maxmemory == 0 { - let s = System::new_all(); + let s = System::new_with_specifics( + RefreshKind::nothing().with_memory(MemoryRefreshKind::everything()), + ); self.default_maxmemory = Byte::from_u64(s.total_memory()) .get_adjusted_unit(Unit::MiB) .get_value() as u32;