diff --git a/src/runtime-rs/crates/resource/src/lib.rs b/src/runtime-rs/crates/resource/src/lib.rs index 23669ccb0..464891790 100644 --- a/src/runtime-rs/crates/resource/src/lib.rs +++ b/src/runtime-rs/crates/resource/src/lib.rs @@ -17,7 +17,9 @@ pub mod manager; mod manager_inner; pub mod network; pub mod resource_persist; -use hypervisor::{BlockConfig, HybridVsockConfig, ProtectionDeviceConfig, VsockConfig}; +use hypervisor::{ + BlockConfig, HybridVsockConfig, PortDeviceConfig, ProtectionDeviceConfig, VsockConfig, +}; use network::NetworkConfig; pub mod rootfs; pub mod share_fs; @@ -36,6 +38,7 @@ pub enum ResourceConfig { HybridVsock(HybridVsockConfig), Vsock(VsockConfig), Protection(ProtectionDeviceConfig), + PortDevice(PortDeviceConfig), } #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/src/runtime-rs/crates/resource/src/manager_inner.rs b/src/runtime-rs/crates/resource/src/manager_inner.rs index c151d8170..ba5eae5cf 100644 --- a/src/runtime-rs/crates/resource/src/manager_inner.rs +++ b/src/runtime-rs/crates/resource/src/manager_inner.rs @@ -193,6 +193,14 @@ impl ResourceManagerInner { .await .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.")?; + } }; }