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:
alex.lyn
2025-06-13 17:28:04 +08:00
parent 8c1482a221
commit 6ea1494701
2 changed files with 6 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ pub enum ResourceConfig {
Vsock(VsockConfig),
Protection(ProtectionDeviceConfig),
PortDevice(PortDeviceConfig),
InitData(BlockConfig),
}
#[derive(Debug, Clone, Copy, PartialEq)]

View File

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