Skip to content

Conversation

@benhillis
Copy link
Member

@benhillis benhillis commented Jan 16, 2026

The primary behavior change introduced by this PR is that virtiofs can now mount sub-directories instead of just the entire path. This is achieved by using a GUID tag for the vitiofs share and introducing a query method to ask the wsl service for the source of a virtiofs share, instead of relying on parsing the /proc/pid/mountinfo file.

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 enables virtiofs to mount subdirectories instead of being limited to full drive volumes. The implementation includes adding the canonicalized path to virtiofs tag names and introducing a fallback mechanism to use Plan9 if virtiofs share creation fails.

Changes:

  • Removed the drive-root restriction for virtiofs mounts, allowing arbitrary directories to be mounted
  • Updated virtiofs tag generation to include the full canonicalized path instead of just the drive letter
  • Added automatic fallback from virtiofs to Plan9 when share creation fails
  • Refactored mount logic by extracting common Plan9 mounting code into a separate function

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/windows/service/exe/WslCoreVm.cpp Updated virtiofs tag generation to include full canonicalized paths; removed drive-root validation
src/shared/inc/stringshared.h Removed IsDriveRoot utility function (no longer needed)
src/linux/init/util.cpp Updated virtiofs source parsing to extract full paths from tags instead of just drive letters
src/linux/init/drvfs.h Renamed MountPlan9Filesystem to MountPlan9Share; added new MountPlan9 wrapper function
src/linux/init/drvfs.cpp Refactored mount logic to try virtiofs first with Plan9 fallback; extracted common Plan9 logic
src/linux/init/config.cpp Updated function calls to use renamed MountPlan9Share; adjusted mount source filtering
test/windows/UnitTests.cpp Removed WslPath test from general unit tests
test/windows/DrvFsTests.cpp Added WslPath test to DrvFs test suite; removed virtiofs skip conditions
test/windows/Common.cpp Refactored string concatenation to use std::format
test/linux/unit_tests/lxtmount.c Added wildcard pattern matching for mount options validation
test/linux/unit_tests/lxtfs.c Updated test expectations to use wildcards for rfd/wfd values

@benhillis benhillis force-pushed the user/benhill/virtiofs_mount_directories branch from 8d0830e to a94e3f5 Compare January 23, 2026 17:47
@benhillis benhillis requested a review from Copilot January 23, 2026 17:48
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

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

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