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:
Zhongtao Hu
2023-06-20 14:27:51 +08:00
parent 20f1f62a2a
commit 5d6199f9bc
5 changed files with 54 additions and 60 deletions

View File

@@ -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)]

View File

@@ -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.")?;
}
};
}