firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

Restore resource allocators from snapshot

Open Manciukic opened this issue 9 months ago • 2 comments

What

Currently the ResourceAllocator is not restored from the snapshot, but its state is rebuilt by replaying allocations with ExactMatch (example).

Why

The current pattern for restoring the state is cumbersome and prone to error. For example, acpi and mptable allocations in the system memory are not replayed, meaning that the allocator state would be different after restore. It works fine for now because we don't allow for changing state after restore, but new features may be impacted by this, like hotplugging.

How

We should serialize its state in the snapshot, as proposed in https://github.com/rust-vmm/vm-allocator/pull/40, and remove the replayed ExactMatch allocations.

Additional Details

  • https://github.com/firecracker-microvm/firecracker/pull/5139#discussion_r2059965612

Manciukic avatar Apr 25 '25 10:04 Manciukic

I can take this issue on as well due to relevance with the other.

DakshinD avatar Apr 25 '25 10:04 DakshinD

The rust-vmm PR has been merged (https://github.com/rust-vmm/vm-allocator/pull/40), it will be possible to implement the firecracker side once it gets released.

Manciukic avatar Apr 30 '25 17:04 Manciukic

@Manciukic Quick check in to see if the rust-vmm side was released? If so, I can take this issue on.

DakshinD avatar Jun 22 '25 17:06 DakshinD

Hi @DakshinD. Yes, this was released in rust-vmm side. However, I needed this change for the PCIe feature branch that I am working on. So, I have brought in the necessary changes there. The changes are still in the PCI branch and they'll come in main branch when we merge PCI support.

bchalios avatar Jun 23 '25 07:06 bchalios

We merged the feature/pci branch into main which includes this refactor.

Manciukic avatar Aug 20 '25 13:08 Manciukic