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

Function configure_system

arch/src/riscv64/mod.rs:164–193  ·  view source on GitHub ↗
(
    guest_mem: &GuestMemoryMmap,
    cmdline: &str,
    num_vcpu: u32,
    device_info: &HashMap<(DeviceType, String), T, S>,
    initrd: &Option<super::InitramfsConfig>,
    pci_space_info: &[PciSp

Source from the content-addressed store, hash-verified

162/// Configures the system and should be called once per vm before starting vcpu threads.
163#[allow(clippy::too_many_arguments)]
164pub fn configure_system<T: DeviceInfoForFdt + Clone + Debug, S: ::std::hash::BuildHasher>(
165 guest_mem: &GuestMemoryMmap,
166 cmdline: &str,
167 num_vcpu: u32,
168 device_info: &HashMap<(DeviceType, String), T, S>,
169 initrd: &Option<super::InitramfsConfig>,
170 pci_space_info: &[PciSpaceInfo],
171 aia_device: &Arc<Mutex<dyn Vaia>>,
172) -> super::Result<()> {
173 let isa_string = isa_string_from_host()?;
174 let fdt_final = fdt::create_fdt(
175 guest_mem,
176 cmdline,
177 num_vcpu,
178 &isa_string,
179 device_info,
180 aia_device,
181 initrd,
182 pci_space_info,
183 )
184 .map_err(|_| Error::SetupFdt)?;
185
186 if log_enabled!(Level::Debug) {
187 fdt::print_fdt(&fdt_final);
188 }
189
190 fdt::write_fdt_to_memory(&fdt_final, guest_mem).map_err(Error::WriteFdtToMemory)?;
191
192 Ok(())
193}
194
195/// Returns the memory address where the initramfs could be loaded.
196pub fn initramfs_load_addr(

Callers

nothing calls this directly

Calls 4

isa_string_from_hostFunction · 0.85
create_fdtFunction · 0.70
print_fdtFunction · 0.70
write_fdt_to_memoryFunction · 0.70

Tested by

no test coverage detected