pub struct ResourceUpdate {
pub vcpus: Option<u32>,
pub memory_mb: Option<u32>,
pub limits: ResourceLimits,
}Expand description
A resource update request.
Fields set to None are left unchanged.
Fields§
§vcpus: Option<u32>vCPU count change (Tier 1 — will be rejected).
memory_mb: Option<u32>Memory in MiB change (Tier 1 — will be rejected).
limits: ResourceLimitsCgroup-based limits (Tier 2 — applied by the selected backend).
Implementations§
Source§impl ResourceUpdate
impl ResourceUpdate
Sourcepub fn has_tier1_changes(&self) -> bool
pub fn has_tier1_changes(&self) -> bool
Check if any Tier 1 (immutable) fields are requested.
Sourcepub fn has_tier2_changes(&self) -> bool
pub fn has_tier2_changes(&self) -> bool
Check if any Tier 2 (cgroup) fields are requested.
Sourcepub fn apply_to_config(&self, config: &mut BoxConfig)
pub fn apply_to_config(&self, config: &mut BoxConfig)
Merge every explicitly requested value into a complete Box config.
Sandbox live updates use the resulting full snapshot because the A3S
OCI update contract replaces linux.resources atomically rather than
applying a sequence of partial cgroup writes.
Sourcepub fn apply_to_limits(&self, limits: &mut ResourceLimits)
pub fn apply_to_limits(&self, limits: &mut ResourceLimits)
Merge every explicitly requested Tier 2 value into existing limits.
Sourcepub fn tier2_change_names(&self) -> Vec<&'static str>
pub fn tier2_change_names(&self) -> Vec<&'static str>
Stable names for Tier 2 fields carried by this request.
Sourcepub fn build_microvm_cgroup_commands(&self) -> Vec<String>
pub fn build_microvm_cgroup_commands(&self) -> Vec<String>
Build shell commands to apply Tier 2 cgroup changes inside a MicroVM guest.
Host Sandbox updates must use the A3S OCI SDK and never call this method.
For a MicroVM, the resize exec runs in the guest root cgroup, so each
command resolves the per-container box-<pid>-<seq> slice at runtime.
A bare /sys/fs/cgroup/<file> write would hit the root cgroup and silently
leave the container’s limits unchanged.
Trait Implementations§
Source§impl Clone for ResourceUpdate
impl Clone for ResourceUpdate
Source§fn clone(&self) -> ResourceUpdate
fn clone(&self) -> ResourceUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceUpdate
impl Debug for ResourceUpdate
Source§impl Default for ResourceUpdate
impl Default for ResourceUpdate
Source§fn default() -> ResourceUpdate
fn default() -> ResourceUpdate
Auto Trait Implementations§
impl Freeze for ResourceUpdate
impl RefUnwindSafe for ResourceUpdate
impl Send for ResourceUpdate
impl Sync for ResourceUpdate
impl Unpin for ResourceUpdate
impl UnsafeUnpin for ResourceUpdate
impl UnwindSafe for ResourceUpdate
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more