runtime-rs: bring hybridVsock devices in manager.

Currently, virtio_vsock are still outside of the device
manager. This causes some management issues,such as the
inability to unify PCI address management.

Just do some work for hybrid vsock.

Fixes: #7655

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
alex.lyn
2023-08-31 14:16:19 +08:00
parent b467f2ef68
commit 7870b33a2d
21 changed files with 137 additions and 75 deletions

View File

@@ -17,7 +17,7 @@ pub mod manager;
mod manager_inner;
pub mod network;
pub mod resource_persist;
use hypervisor::BlockConfig;
use hypervisor::{BlockConfig, HybridVsockConfig};
use network::NetworkConfig;
pub mod rootfs;
pub mod share_fs;
@@ -32,6 +32,7 @@ pub enum ResourceConfig {
Network(NetworkConfig),
ShareFs(SharedFsInfo),
VmRootfs(BlockConfig),
HybridVsock(HybridVsockConfig),
}
#[derive(Debug, Clone, Copy, PartialEq)]

View File

@@ -126,6 +126,11 @@ impl ResourceManagerInner {
.await
.context("do handle device failed.")?;
}
ResourceConfig::HybridVsock(hv) => {
do_handle_device(&self.device_manager, &DeviceConfig::HybridVsockCfg(hv))
.await
.context("do handle hybrid-vsock device failed.")?;
}
};
}