Repository navigation
Conversation
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>
andreiltd
requested review from
danbugs,
dblnz,
devigned,
jprendes,
jsturtevant,
ludfjig,
simongdavies,
squillace and
syntactically
as code owners
October 16, 2026 12:10
Contributor
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.
Comment on lines
+386
to
+396
| for addr in reserved { | ||
| if let Some(lower) = &mut inner.lower | ||
| && lower.contains(addr) | ||
| { | ||
| lower.allocation_len(addr)?; | ||
| lower.reserve_addr(addr)?; | ||
| } else { | ||
| inner.upper.allocation_len(addr)?; | ||
| inner.upper.reserve_addr(addr)?; | ||
| } | ||
| } |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.