mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 14:58:16 +00:00
runtime-rs: Add InitData Resource type for block device management
To correctly manage initdata as a block device, a new InitData Resource type, inherently a block device, has been introduced within the ResourceManager. As a component of the Sandbox's resources, this InitData Resource needs to be appropriately handled by the Device Manager's handler. Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -40,6 +40,7 @@ pub enum ResourceConfig {
|
||||
Vsock(VsockConfig),
|
||||
Protection(ProtectionDeviceConfig),
|
||||
PortDevice(PortDeviceConfig),
|
||||
InitData(BlockConfig),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
|
@@ -204,6 +204,11 @@ impl ResourceManagerInner {
|
||||
.await
|
||||
.context("do handle port device failed.")?;
|
||||
}
|
||||
ResourceConfig::InitData(id) => {
|
||||
do_handle_device(&self.device_manager, &DeviceConfig::BlockCfg(id))
|
||||
.await
|
||||
.context("do handle initdata block device failed.")?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user