mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 12:06:49 +00:00
runtime-rs: Introduce PortDevice in resource manager in sandbox
A new resource type `PortDevice` is introduced which is dedicated for handling root ports/switch ports during sandbox creation(VM). Fixes #10361 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
parent
1d670bb46c
commit
d435712ccb
@ -17,7 +17,9 @@ pub mod manager;
|
|||||||
mod manager_inner;
|
mod manager_inner;
|
||||||
pub mod network;
|
pub mod network;
|
||||||
pub mod resource_persist;
|
pub mod resource_persist;
|
||||||
use hypervisor::{BlockConfig, HybridVsockConfig, ProtectionDeviceConfig, VsockConfig};
|
use hypervisor::{
|
||||||
|
BlockConfig, HybridVsockConfig, PortDeviceConfig, ProtectionDeviceConfig, VsockConfig,
|
||||||
|
};
|
||||||
use network::NetworkConfig;
|
use network::NetworkConfig;
|
||||||
pub mod rootfs;
|
pub mod rootfs;
|
||||||
pub mod share_fs;
|
pub mod share_fs;
|
||||||
@ -36,6 +38,7 @@ pub enum ResourceConfig {
|
|||||||
HybridVsock(HybridVsockConfig),
|
HybridVsock(HybridVsockConfig),
|
||||||
Vsock(VsockConfig),
|
Vsock(VsockConfig),
|
||||||
Protection(ProtectionDeviceConfig),
|
Protection(ProtectionDeviceConfig),
|
||||||
|
PortDevice(PortDeviceConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
@ -193,6 +193,14 @@ impl ResourceManagerInner {
|
|||||||
.await
|
.await
|
||||||
.context("do handle protection device failed.")?;
|
.context("do handle protection device failed.")?;
|
||||||
}
|
}
|
||||||
|
ResourceConfig::PortDevice(pd) => {
|
||||||
|
do_handle_device(
|
||||||
|
&self.device_manager,
|
||||||
|
&DeviceConfig::PortDeviceCfg(pd.clone()),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.context("do handle port device failed.")?;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user