mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
runtime-rs: use device manager to handle vm rootfs
use device manager to handle vm rootfs, after attach the block device of vm rootfs, we need to increase index number Fixes: #7119 Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com> Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com> Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -17,6 +17,7 @@ pub mod manager;
|
||||
mod manager_inner;
|
||||
pub mod network;
|
||||
pub mod resource_persist;
|
||||
use hypervisor::BlockConfig;
|
||||
use network::NetworkConfig;
|
||||
pub mod rootfs;
|
||||
pub mod share_fs;
|
||||
@@ -30,6 +31,7 @@ use kata_types::config::hypervisor::SharedFsInfo;
|
||||
pub enum ResourceConfig {
|
||||
Network(NetworkConfig),
|
||||
ShareFs(SharedFsInfo),
|
||||
VmRootfs(BlockConfig),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
|
||||
@@ -121,6 +121,11 @@ impl ResourceManagerInner {
|
||||
.await
|
||||
.context("failed to handle network")?;
|
||||
}
|
||||
ResourceConfig::VmRootfs(r) => {
|
||||
do_handle_device(&self.device_manager, &DeviceConfig::BlockCfg(r))
|
||||
.await
|
||||
.context("do handle device failed.")?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user