Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Reservation validation rejects every nonempty pool swap, causing restore failures with retained buffers and posted chains.
1 open finding
What changed in this PR
This PR uses shared pool identity to track virtqueue allocation ownership across snapshot restores.
Changes:
- Replace pool generation counters with
Rcpointer identity and pool swaps. - Keep retained leases tied to their original pools.
- Expand swap tests and update transport documentation.
| File | Description |
|---|---|
| src/hyperlight_host/tests/integration_test.rs | Rename the retained-buffer test. |
| src/hyperlight_guest/src/transport/context.rs | Clarify pool ownership and restore safety comments. |
| src/hyperlight_guest/src/transport/backing.rs | Update alias allocator terminology. |
| src/hyperlight_common/src/virtq/producer.rs | Swap pools while preserving posted chains. |
| src/hyperlight_common/src/virtq/pool/tests.rs | Test swap reservations, ordering, and validation. |
| src/hyperlight_common/src/virtq/pool/slot.rs | Implement pool identity and replacement allocation state. |
| src/hyperlight_common/src/virtq/buffer.rs | Return leases to their original pools. |
| docs/virtio-host-guest-communication.md | Document pool swaps and retained ownership. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6b8cdb4 to
2940278
Compare
This comment has been minimized.
This comment has been minimized.
8de61b5 to
4062922
Compare
Instead of threading generation through pools it's actually simpler to use Rc::ptr_eq to check if pool belongs to current snapshot generation and swap pools on restore. Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
4062922 to
97d57b1
Compare
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |

Instead of threading generation through pools it's actually simpler to use
Rc::ptr_eqto check if pool belongs to current snapshot generation and swap pools on restore.