refactor(migtd): unify migration and rebinding VMM request buffer layout#869
Open
haitaohuang wants to merge 3 commits into
Open
refactor(migtd): unify migration and rebinding VMM request buffer layout#869haitaohuang wants to merge 3 commits into
haitaohuang wants to merge 3 commits into
Conversation
haitaohuang
commented
May 29, 2026
b34b699 to
c335d76
Compare
262ea9a to
72fb08f
Compare
72fb08f to
9627bef
Compare
Contributor
Author
|
Added 2 more commits to fix parser tests for vmcall-raw and non-vmcall-raw. (all previously in rebinding.rs and gated by main+vmcall-raw+policy_v2 so not invoked by ci). Removed the workaround in parser now that is not needed, see commit messages for details |
Contributor
|
@haitaohuang can you please resolve the conflict? Thanks |
Add init_td_info [u8; 512] field to MigtdMigrationInformation so both migration and rebinding use the same VMM request buffer layout. Delete RebindingInfo, InitData, and init_data.rs. Widen policy_v2 cfg gates that were incorrectly restricted to vmcall-raw only. Peer-to-peer wire protocol is unchanged. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The policy_v2 length check accepted a full-size payload with
has_init_data == 0 — a band-aid for a test whose fixture started
writing the full struct after the buffer-unification refactor grew
its size. Replace it with a symmetric check that rejects whenever the
flag and length disagree:
(has_init_data == 1) != (data_length == full_size) => reject
Move the 8 parser tests from rebinding.rs (only built under
main+policy_v2+vmcall-raw, never run by `xtask lib-test`) to a
policy_v2-gated module in mod.rs. The shared build_mig_info fixture
is now layout-aware so the same tests cover both vmcall-raw (56/568)
and non-vmcall-raw (72/584) struct layouts.
Make MIGTD_MIGRATION_INFO_HEADER_SIZE pub(crate) and update two
fixtures to emit short-form payloads that satisfy the new check:
data::create_mig_info_hob (policy_v2 only) and
session::build_migration_payload. The production HOB consumer
create_migration_information stays layout-neutral; consistency is now
enforced inside the parser.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Add a third `cargo test --lib` invocation for migtd under `--no-default-features --features main,policy_v2,vmcall-raw` so the rebinding module and the vmcall-raw layout of MigtdMigrationInformation are exercised by the Library Crates workflow. `--lib` is required because the bin's `fn main` collides with the cfg(test) stub under `main + !AzCVMEmu` (pre-existing, out of scope). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
02c0485 to
c0ab8e6
Compare
Contributor
Author
Rebased |
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.
fixes #868