mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-17 00:43:36 +00:00
runtime-rs: Store additional field for hypervisor state
Implementing Persist API for cloud-hypervisor was done partially with initial support for cloud-hypervisor. Store and retrieve additional fields to/from the hypervisor state. Fixes: #6202 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
a5f0b92bca
commit
0b78296dca
@ -147,10 +147,11 @@ impl Persist for CloudHypervisorInner {
|
|||||||
vm_path: self.vm_path.clone(),
|
vm_path: self.vm_path.clone(),
|
||||||
jailed: false,
|
jailed: false,
|
||||||
jailer_root: String::default(),
|
jailer_root: String::default(),
|
||||||
netns: None,
|
netns: self.netns.clone(),
|
||||||
config: self.hypervisor_config(),
|
config: self.hypervisor_config(),
|
||||||
run_dir: self.run_dir.clone(),
|
run_dir: self.run_dir.clone(),
|
||||||
cached_block_devices: Default::default(),
|
guest_protection_to_use: self.guest_protection_to_use.clone(),
|
||||||
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -160,15 +161,29 @@ impl Persist for CloudHypervisorInner {
|
|||||||
_hypervisor_args: Self::ConstructorArgs,
|
_hypervisor_args: Self::ConstructorArgs,
|
||||||
hypervisor_state: Self::State,
|
hypervisor_state: Self::State,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let ch = Self {
|
let (tx, rx) = channel(true);
|
||||||
|
|
||||||
|
let mut ch = Self {
|
||||||
config: Some(hypervisor_state.config),
|
config: Some(hypervisor_state.config),
|
||||||
state: VmmState::NotReady,
|
state: VmmState::NotReady,
|
||||||
id: hypervisor_state.id,
|
id: hypervisor_state.id,
|
||||||
vm_path: hypervisor_state.vm_path,
|
vm_path: hypervisor_state.vm_path,
|
||||||
run_dir: hypervisor_state.run_dir,
|
run_dir: hypervisor_state.run_dir,
|
||||||
|
netns: hypervisor_state.netns,
|
||||||
|
guest_protection_to_use: hypervisor_state.guest_protection_to_use.clone(),
|
||||||
|
|
||||||
|
pending_devices: vec![],
|
||||||
|
device_ids: HashMap::<String, String>::new(),
|
||||||
|
tasks: None,
|
||||||
|
shutdown_tx: Some(tx),
|
||||||
|
shutdown_rx: Some(rx),
|
||||||
|
timeout_secs: CH_DEFAULT_TIMEOUT_SECS as i32,
|
||||||
|
jailer_root: String::default(),
|
||||||
|
ch_features: None,
|
||||||
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
ch._capabilities = ch.capabilities().await?;
|
||||||
|
|
||||||
Ok(ch)
|
Ok(ch)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user