Skip to content

Conversation

@benhillis
Copy link
Member

This is mostly a cherry-pick of #13819 to make sure the main and feature/wsl-for-apps branches to not diverge too much.

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 refactors virtio device GUID constants to use consistent naming conventions and centralized definitions. It cherry-picks changes from PR #13819 to maintain alignment between the main and feature/wsl-for-apps branches. The refactoring consolidates scattered GUID definitions into appropriate header files with standardized naming (SCREAMING_SNAKE_CASE with _DEVICE_ID and _CLASS_ID suffixes), making the codebase more maintainable and easier to understand.

Key changes:

  • Consolidated virtio device type GUIDs (VIRTIO_FS_DEVICE_ID, VIRTIO_NET_DEVICE_ID, VIRTIO_PMEM_DEVICE_ID) in GuestDeviceManager.h
  • Centralized WSL-specific virtio class IDs (VIRTIO_FS_ADMIN_CLASS_ID, VIRTIO_FS_CLASS_ID, VIRTIO_NET_CLASS_ID, VIRTIO_PMEM_CLASS_ID) in WslCoreVm.cpp
  • Refactored VirtioNetworking to accept class ID as a constructor parameter rather than using a static member, enabling better flexibility and testability
  • Updated Microsoft.WSL.DeviceHost package version from 20251201.1 to 20251202.1

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/windows/service/exe/WslCoreVm.h Removed static GUID constants that are now defined elsewhere
src/windows/service/exe/WslCoreVm.cpp Added centralized definitions for WSL-specific virtio class IDs; updated references to use new constant names and pass class ID to VirtioNetworking constructor
src/windows/common/VirtioNetworking.h Modified constructor to accept class ID parameter; removed static class ID and device ID constants; added m_virtioNetworkClsid member field; updated ModifyOpenPorts signature to remove redundant clsid parameter
src/windows/common/VirtioNetworking.cpp Updated constructor to initialize m_virtioNetworkClsid from parameter; removed try/CATCH_LOG wrapper from Initialize(); updated all references to use new GUID names and m_virtioNetworkClsid member; updated ModifyOpenPorts calls to remove clsid parameter
src/windows/common/GuestDeviceManager.h Centralized virtio device type GUID definitions with descriptive comment
src/windows/common/GuestDeviceManager.cpp Updated reference from VIRTIO_VIRTIOFS_DEVICE_ID to VIRTIO_FS_DEVICE_ID
packages.config Updated Microsoft.WSL.DeviceHost package version

@benhillis benhillis merged commit 1390e64 into master Dec 4, 2025
12 checks passed
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