firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

Clean up `create_fdt` function in `src/vmm/src/arch/aarch64/fdt.rs`

Open roypat opened this issue 7 months ago • 6 comments

The create_fdt function has two eccentricities that can be cleaned up:

  1. It is unnecessarily parametrized by std::hash::HashBuilder, and
  2. 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

roypat avatar Jul 23 '24 11:07 roypat