Skip to content

Conversation

@OneBlue
Copy link
Collaborator

@OneBlue OneBlue commented Jan 14, 2026

Summary of the Pull Request

This change addresses comments that were published after #14047 was merged

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@OneBlue OneBlue marked this pull request as ready for review January 14, 2026 00:51
@OneBlue OneBlue requested a review from a team as a code owner January 14, 2026 00:51
Copilot AI review requested due to automatic review settings January 14, 2026 00:51
Copy link
Contributor

Copilot AI left a comment

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 addresses follow-up feedback from PR #14047, which introduced persistent sessions. The main change is refactoring the MapVmPort API to separate mapping and unmapping operations into two distinct methods: MapVmPort (for creating port mappings) and UnmapVmPort (for removing them). Previously, a single MapVmPort method with a boolean Remove parameter handled both operations.

Changes:

  • Split the MapVmPort API into separate MapVmPort and UnmapVmPort methods in the IDL interface, session layer, and virtual machine layer
  • Updated all call sites in tests and container implementation to use the appropriate method
  • Added internal MapPortImpl helper that continues to use the unified wire protocol with a Stop flag
  • Added test coverage to validate that WSLASessionFlagsOpenExisting creates a new session when no matching session exists

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/windows/wslaservice/inc/wslaservice.idl Split MapVmPort into separate MapVmPort and UnmapVmPort methods in the COM interface
src/windows/wslaservice/exe/WSLAVirtualMachine.h Added MapPort, UnmapPort, and private MapPortImpl method declarations
src/windows/wslaservice/exe/WSLAVirtualMachine.cpp Implemented separate MapPort and UnmapPort methods that delegate to MapPortImpl
src/windows/wslaservice/exe/WSLASession.h Updated interface declarations for MapVmPort and UnmapVmPort
src/windows/wslaservice/exe/WSLASession.cpp Implemented separate MapVmPort and UnmapVmPort methods
src/windows/wslaservice/exe/WSLAContainer.cpp Updated container port mapping cleanup to use UnmapPort instead of MapPort with true flag
test/windows/WSLATests.cpp Updated test calls to use UnmapVmPort for unmapping operations and added test for session creation with WSLASessionFlagsOpenExisting

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.

3 participants