firecracker
firecracker copied to clipboard
Clean up `create_fdt` function in `src/vmm/src/arch/aarch64/fdt.rs`
The create_fdt
function has two eccentricities that can be cleaned up:
- It is unnecessarily parametrized by
std::hash::HashBuilder
, and - It both writes the flattened device tree to guest memory, as well as returns it (however this return value is ignored the only call site). In the spirit of separating concerns, it should not write the FDT to guest memory - instead the caller should use the return value and write it to memory. This might also simplify our unittesting a little bit, as we no longer need to construct
GuestMemoryMmap
in the tests.
See also https://github.com/firecracker-microvm/firecracker/pull/4687#discussion_r1686789518