MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / add_initramfs_data

Method add_initramfs_data

devices/src/legacy/fw_cfg.rs:716–721  ·  view source on GitHub ↗
(&mut self, file: &File)

Source from the content-addressed store, hash-verified

714 }
715
716 pub fn add_initramfs_data(&mut self, file: &File) -> Result<()> {
717 let initramfs_size = file.metadata()?.len();
718 self.known_items[FW_CFG_INITRD_SIZE as usize] = FwCfgContent::U32(initramfs_size as _);
719 self.known_items[FW_CFG_INITRD_DATA as usize] = FwCfgContent::File(0, file.try_clone()?);
720 Ok(())
721 }
722
723 fn read_content(content: &FwCfgContent, offset: u32, data: &mut [u8], size: u32) -> Option<u8> {
724 let start = offset as usize;

Callers 2

populate_fw_cfgMethod · 0.80
test_initram_fsFunction · 0.80

Calls 3

metadataMethod · 0.80
lenMethod · 0.45
try_cloneMethod · 0.45

Tested by 1

test_initram_fsFunction · 0.64