netvsp: Save VF serial number for disassociation message#3698
Open
sunilmut wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates NetVSP’s VF association/disassociation handling so that the disassociation message reuses the same VF serial number that was previously advertised to the guest, and persists that value through save/restore. It also expands test coverage to validate serial-number behavior across different adapter indices and guest OS ID behaviors.
Changes:
- Persist the last-advertised VF serial number in
PrimaryChannelStateand in NetVSP saved state. - Update VF association/disassociation message generation to reuse the stored serial number for disassociation.
- Refactor/expand NetVSP tests to validate association + disassociation serial-number consistency (including Windows guest OS ID behavior).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vm/devices/net/netvsp/src/lib.rs | Tracks and reuses VF serial number across association/disassociation, wires it into save/restore. |
| vm/devices/net/netvsp/src/saved_state.rs | Adds optional saved-state field for the advertised VF serial number. |
| vm/devices/net/netvsp/src/test.rs | Refactors dynamic VF tests and adds coverage for serial-number expectations and Windows guest OS ID provider. |
9551f88 to
6272cfa
Compare
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.
Windows guest expects that the serial number in the disassociation message should match exactly the serial number from the association message. Otherwise, it will fail the VF association/disassociation.
With multi VF setup and now that we have the adapter index (serial number) starting at > 0, this also causes problems with association/disassociation.