mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-18 21:55:59 +00:00
runtime-rs: Introduce a cached sandbox exit information
Introduce an exit_info field in SandboxInner so sandbox teardown can store a stable exit result in runtime state. The follow-on WaitSandbox rework needs a place to keep the final SandboxExitInfo after the sandbox has already stopped. Without that cached result, later waiters would have no consistent value to return once the original stop event has passed. This change only adds the state holder. Behaviour changes follow in later commits. Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -75,6 +75,7 @@ use resource::{ResourceConfig, ResourceManager};
|
||||
use runtime_spec as spec;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::SystemTime;
|
||||
use strum::Display;
|
||||
use tokio::sync::{mpsc::Sender, Mutex, RwLock};
|
||||
use tracing::instrument;
|
||||
@@ -96,12 +97,14 @@ pub enum SandboxState {
|
||||
|
||||
struct SandboxInner {
|
||||
state: SandboxState,
|
||||
exit_info: Option<SandboxExitInfo>,
|
||||
}
|
||||
|
||||
impl SandboxInner {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
state: SandboxState::Init,
|
||||
exit_info: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user