[shimV2] Refactor V2 shim for platform consistency and remove vPMem support in v2 LCOW#2701
Merged
rawahars merged 6 commits intomicrosoft:mainfrom Apr 23, 2026
Merged
[shimV2] Refactor V2 shim for platform consistency and remove vPMem support in v2 LCOW#2701rawahars merged 6 commits intomicrosoft:mainfrom
rawahars merged 6 commits intomicrosoft:mainfrom
Conversation
shreyanshjain7174
approved these changes
Apr 23, 2026
Contributor
shreyanshjain7174
left a comment
There was a problem hiding this comment.
LGTM — clean refactor. The method renames, vPMem removal logic, and build tag enforcement all look correct. Verified no stale callers of old names remain in production code.
Two minor nits left as inline comments (a copy-paste doc comment and a stale error message string). Neither blocks merge.
jterry75
reviewed
Apr 23, 2026
jterry75
reviewed
Apr 23, 2026
Refactor the vpci controller to make the guest-side interface
build-specific instead of LCOW-only on the shared type:
- Move the guest vPCI interface out of types.go and define a
per-build guestVPCI interface in vpci_lcow.go (with AddVPCIDevice)
and vpci_wcow.go (empty, no-op).
- Rename Controller field linuxGuestVPCI -> guestVPCI and update
New() accordingly.
- Update build tags on shared files to `windows && (lcow || wcow)`.
- Rename LCOW-specific test/mock files to reflect their scope:
mocks/mock_vpci.go -> mocks/mock_lcow_vpci.go
vpci_test.go -> vpci_lcow_test.go
- Remove vpci_unsupported.go; coverage is now provided by the
per-OS build files.
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
The guestmanager.Guest methods and the controller-side interfaces that
consume them are already split into LCOW- and WCOW-specific files via
build tags, so the OS prefix on method names (AddLCOWMappedVirtualDisk,
AddWCOWMappedVirtualDisk, AddLCOWCombinedLayers, AddLCOWNetworkInterface,
AddWCOWBlockCIMs, AddLCOWMappedDirectory, etc.) is redundant and made
the controller interfaces diverge needlessly between platforms.
Rename the methods to their unprefixed forms (AddMappedVirtualDisk,
AddMappedVirtualDiskForContainerScratch, RemoveMappedVirtualDisk,
AddCombinedLayers / RemoveCombinedLayers, AddNetworkInterface /
RemoveNetworkInterface, AddBlockCIMs / RemoveBlockCIMs, AddMappedDirectory
/ RemoveMappedDirectory) across:
- internal/vm/guestmanager (scsi, combinedlayers, network, block_cims,
mapped_directory, doc)
- internal/controller/device/scsi (mount + tests, controller tests,
disk tests)
- internal/controller/device/plan9 (mount + types + tests, share tests,
controller tests, generated mocks)
- internal/controller/linuxcontainer (container, layers, types and
generated mocks + tests)
- internal/controller/network (network_lcow guestNetwork interface)
No behavioral change; pure rename to give the LCOW and WCOW guest
surfaces a consistent, platform-neutral API.
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
4cfdf85 to
502d831
Compare
jterry75
reviewed
Apr 23, 2026
jterry75
reviewed
Apr 23, 2026
| // | ||
| // Deprecated: use [CreateWCOW] and [layers.WCOWScratchDir]. | ||
| // | ||
| //nolint:staticcheck // SA5011: staticcheck thinks `opts` may be nil, even though we fail if it is |
Contributor
There was a problem hiding this comment.
Youll have to leave this. While correct, it doesnt know that t.Fatal panics here so you couldnt hit the 2nd case.
…nt tests Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
- Gate lcow parity tests behind the `lcow` build tag and run them in a separate CI step so the default non-functional test job no longer pulls them in. - Run non-functional tests from the `test` working directory to match the new parity job layout. - Fix malformed build constraint in internal/controller/device/vpci/utils.go (`windows && (lcow wcow)`) by simplifying it to `windows` as its used by old shim. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
jterry75
approved these changes
Apr 23, 2026
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.
Overview
This PR focuses on standardizing the guest manager and controller APIs across LCOW and WCOW platforms, making internal interfaces cleaner, more idiomatic, and platform-neutral. Additionally, it officially removes support for Virtual PMem (vPMem) devices within the v2 LCOW shim.
Key Themes
LCOWandWCOWprefixes provides a consistent, platform-agnostic API for controller interfaces. This is a pure refactor with no behavioral changes.