(
guest_mem: &GuestMemoryMmap,
cmdline: &str,
vcpu_mpidr: &[u64],
vcpu_topology: Option<(u16, u16, u16, u16)>,
device_info: &HashMap<(DeviceType, String), T, S>,
initrd: &Optio
| 123 | /// Configures the system and should be called once per vm before starting vcpu threads. |
| 124 | #[allow(clippy::too_many_arguments)] |
| 125 | pub fn configure_system<T: DeviceInfoForFdt + Clone + Debug, S: ::std::hash::BuildHasher>( |
| 126 | guest_mem: &GuestMemoryMmap, |
| 127 | cmdline: &str, |
| 128 | vcpu_mpidr: &[u64], |
| 129 | vcpu_topology: Option<(u16, u16, u16, u16)>, |
| 130 | device_info: &HashMap<(DeviceType, String), T, S>, |
| 131 | initrd: &Option<super::InitramfsConfig>, |
| 132 | pci_space_info: &[PciSpaceInfo], |
| 133 | virtio_iommu_bdf: Option<u32>, |
| 134 | gic_device: &Arc<Mutex<dyn Vgic>>, |
| 135 | numa_nodes: &NumaNodes, |
| 136 | pmu_supported: bool, |
| 137 | ) -> super::Result<()> { |
| 138 | let fdt_final = fdt::create_fdt( |
| 139 | guest_mem, |
| 140 | cmdline, |
| 141 | vcpu_mpidr, |
| 142 | vcpu_topology, |
| 143 | device_info, |
| 144 | gic_device, |
| 145 | initrd, |
| 146 | pci_space_info, |
| 147 | numa_nodes, |
| 148 | virtio_iommu_bdf, |
| 149 | pmu_supported, |
| 150 | ) |
| 151 | .map_err(|_| Error::SetupFdt)?; |
| 152 | |
| 153 | if log_enabled!(Level::Debug) { |
| 154 | fdt::print_fdt(&fdt_final); |
| 155 | } |
| 156 | |
| 157 | fdt::write_fdt_to_memory(&fdt_final, guest_mem).map_err(Error::WriteFdtToMemory)?; |
| 158 | |
| 159 | Ok(()) |
| 160 | } |
| 161 | |
| 162 | /// Returns the memory address where the initramfs could be loaded. |
| 163 | pub fn initramfs_load_addr( |
nothing calls this directly
no test coverage detected