mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 14:58:16 +00:00
runtime-rs: Introduce a field host_devices within NamedHypervisorConfig
This commit introduce `host_devices` to help convert vfio devices from a generic hypervisor config to a cloud-hypervisor specific VmConfig. Signed-off-by: alex.lyn <alex.lyn@antgroup.com> Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit is contained in:
@@ -491,6 +491,7 @@ pub struct NamedHypervisorConfig {
|
||||
|
||||
pub shared_fs_devices: Option<Vec<FsConfig>>,
|
||||
pub network_devices: Option<Vec<NetConfig>>,
|
||||
pub host_devices: Option<Vec<DeviceConfig>>,
|
||||
|
||||
// Set to the available guest protection *iff* BOTH of the following
|
||||
// conditions are true:
|
||||
|
@@ -185,8 +185,7 @@ impl CloudHypervisorInner {
|
||||
}
|
||||
|
||||
async fn boot_vm(&mut self) -> Result<()> {
|
||||
let (shared_fs_devices, network_devices, _) = self.get_shared_devices().await?;
|
||||
|
||||
let (shared_fs_devices, network_devices, host_devices) = self.get_shared_devices().await?;
|
||||
let socket = self
|
||||
.api_socket
|
||||
.as_ref()
|
||||
@@ -215,6 +214,7 @@ impl CloudHypervisorInner {
|
||||
guest_protection_to_use: self.guest_protection_to_use.clone(),
|
||||
shared_fs_devices,
|
||||
network_devices,
|
||||
host_devices,
|
||||
};
|
||||
|
||||
let cfg = VmConfig::try_from(named_cfg)?;
|
||||
|
Reference in New Issue
Block a user