(
guest_mem: &GuestMemoryMmap,
cmdline: &str,
num_vcpu: u32,
device_info: &HashMap<(DeviceType, String), T, S>,
initrd: &Option<super::InitramfsConfig>,
pci_space_info: &[PciSp
| 162 | /// Configures the system and should be called once per vm before starting vcpu threads. |
| 163 | #[allow(clippy::too_many_arguments)] |
| 164 | pub 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. |
| 196 | pub fn initramfs_load_addr( |
nothing calls this directly
no test coverage detected