[shimV2] refactor SCSI package to unify the interfaces with build tagged files#2666
Merged
rawahars merged 5 commits intomicrosoft:mainfrom Apr 9, 2026
Merged
[shimV2] refactor SCSI package to unify the interfaces with build tagged files#2666rawahars merged 5 commits intomicrosoft:mainfrom
rawahars merged 5 commits intomicrosoft:mainfrom
Conversation
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
helsaawy
requested changes
Apr 8, 2026
helsaawy
reviewed
Apr 8, 2026
helsaawy
reviewed
Apr 8, 2026
jterry75
requested changes
Apr 9, 2026
| @@ -0,0 +1,17 @@ | |||
| //go:build windows && !wcow && !lcow | |||
Contributor
There was a problem hiding this comment.
Do you really need these? If the entire package is windows && (wcow || lcow) nothing not those could build right? So there is no unsupported tag orientation right?
Contributor
Author
There was a problem hiding this comment.
That's a great idea. Let me add tags to the entire package which would eliminate the need for unsupported.
| // [StateMounted] state. It does not transition the state; that is handled | ||
| // by the caller in [Mount.UnmountFromGuest]. | ||
| func (m *Mount) unmountLCOW(ctx context.Context, guest LinuxGuestSCSIUnmounter) error { | ||
| func (m *Mount) unmountPartition(ctx context.Context, guest GuestSCSIUnmounter) error { |
Contributor
There was a problem hiding this comment.
Interesting. Since this is a mount, I hear you that it's technically a block device partition, but... I think its better to just call it unmount. The term "partition" is overloaded and is immediately confusing on what this is doing to me.
| // [StateMounted] state. It does not transition the state; that is handled | ||
| // by the caller in [Mount.UnmountFromGuest]. | ||
| func (m *Mount) unmountWCOW(ctx context.Context, guest WindowsGuestSCSIUnmounter) error { | ||
| func (m *Mount) unmountPartition(ctx context.Context, guest GuestSCSIUnmounter) error { |
Contributor
There was a problem hiding this comment.
Same, I'd prefer just unmount.
helsaawy
approved these changes
Apr 9, 2026
jterry75
approved these changes
Apr 9, 2026
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
helsaawy
approved these changes
Apr 9, 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.
Summary
This pull request refactors the SCSI controller guest interface to use a unified
GuestSCSIOpsabstraction instead of separate Linux and Windows guest operation interfaces. It also updates the related tests to use a single mock guest implementation and adds new LCOW-specific tests. Additionally, the CI workflow is updated to build and test both LCOW and WCOW tagged packages.It also moves the
Configto the specificlcoworwcowimplementation so that only the applicable options are available.Abstraction and Interface Refactoring:
Controllerstruct and its constructor now use a singleGuestSCSIOpsinterface for guest operations, replacing the previousLinuxGuestSCSIOpsandWindowsGuestSCSIOpsfields and parameters. All guest operation calls in the controller are updated to use this unified interface.Test Suite Updates:
The SCSI controller tests are refactored to use a single
mockGuestOpsimplementation, removing the separate mock types for Linux and Windows guest operations. Test helpers and test cases are updated accordingly.Adds a new
controller_lcow_test.gofile with LCOW-specific tests for guest mount and unmount error handling, using the new mock guest interface.CI Workflow Enhancements:
.github/workflows/ci.ymlto build and test LCOW and WCOW tagged packages for shimV2, ensuring both variants are covered in CI.