Skip to content

netvsp: Save VF serial number for disassociation message#3698

Open
sunilmut wants to merge 2 commits into
microsoft:mainfrom
sunilmut:sunilmut/network_vf_serial_number_fix
Open

netvsp: Save VF serial number for disassociation message#3698
sunilmut wants to merge 2 commits into
microsoft:mainfrom
sunilmut:sunilmut/network_vf_serial_number_fix

Conversation

@sunilmut

@sunilmut sunilmut commented Jun 9, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings June 9, 2026 01:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PrimaryChannelState and 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.

Comment thread vm/devices/net/netvsp/src/lib.rs Outdated
@sunilmut sunilmut force-pushed the sunilmut/network_vf_serial_number_fix branch from 9551f88 to 6272cfa Compare June 9, 2026 22:27
@sunilmut sunilmut marked this pull request as ready for review June 9, 2026 23:28
@sunilmut sunilmut requested a review from a team as a code owner June 9, 2026 23:28
Copilot AI review requested due to automatic review settings June 9, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread vm/devices/net/netvsp/src/lib.rs Outdated
Comment thread vm/devices/net/netvsp/src/lib.rs
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants