Repository navigation
Remove Wildcard GUID in HyperVSocketServer V2 Constructor (#165) - #28213
Closed
Aditya Patwardhan (adityapatwardhan) wants to merge 1 commit into
Closed
Aditya Patwardhan (adityapatwardhan) wants to merge 1 commit into
Aditya Patwardhan (adityapatwardhan) wants to merge 1 commit into
Conversation
Aditya Patwardhan (adityapatwardhan)
requested review from
a team,
Travis Plunk (TravisEz13) and
Dongbo Wang (daxian-dbw)
as code owners
October 14, 2026 22:59
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The V2 binding change needs Windows/Hyper-V connectivity validation beyond the helper’s GUID-selection tests.
0 open findings
What changed in this PR
This PR replaces the V2 Hyper-V session server’s wildcard listener binding with the partition-selection logic already used by V1.
Changes:
- Centralizes partition selection in
GetListenerVmId. - Uses the helper in both server constructors.
- Adds tests for parent and loopback GUID selection.
| File | Description |
|---|---|
| test/xUnit/csharp/test_RemoteHyperV.cs | Tests both partition-selection modes. |
| src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs | Shares partition-selection logic and removes V2 wildcard binding. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Collaborator
|
Dup #28204 |
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.
PR Summary
This pull request refactors the way the Hyper-V socket server determines which VM partition ID to use when listening for connections, improving maintainability and consistency. It introduces a helper method to centralize this logic and updates both the server constructors and tests to use it.
Refactoring and Helper Method Introduction:
GetListenerVmId(bool loopbackMode)toRemoteSessionHyperVSocketServerto encapsulate the logic for choosing the correct VM partition ID (loopback or parent) for the listening socket.Constructor Consistency and Usage:
RemoteSessionHyperVSocketServerto use the newGetListenerVmIdhelper, ensuring consistent partition selection logic across server instantiations. [1] [2]Testing Improvements:
ServerListenerUsesExpectedPartitionVmIdto verify thatGetListenerVmIdreturns the correct VM ID for both loopback and parent partition modes.PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header