adds guest manager interfaces + implementation for guest operations#2598
Open
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Open
adds guest manager interfaces + implementation for guest operations#2598rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
76df85b to
3807b37
Compare
jterry75
reviewed
Feb 11, 2026
jterry75
reviewed
Feb 11, 2026
640e16d to
5515496
Compare
jterry75
reviewed
Feb 13, 2026
jterry75
reviewed
Feb 13, 2026
5515496 to
2625d6a
Compare
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
2625d6a to
2217a34
Compare
jterry75
reviewed
Feb 19, 2026
| } | ||
|
|
||
| // CreateConnection accepts the GCS connection and performs initial setup. | ||
| func (gm *Guest) CreateConnection(ctx context.Context, opts ...ConfigOption) error { |
Contributor
There was a problem hiding this comment.
IMO this part should be a layer up. The other "managers" are about configuration and setup. This one seems to actually invoke things and actually connect to sockets etc.
| ) | ||
|
|
||
| // updateHvSocketAddress configures the HvSocket address for GCS communication. | ||
| func (gm *Guest) updateHvSocketAddress(ctx context.Context, settings *hcsschema.HvSocketAddress) error { |
Contributor
There was a problem hiding this comment.
What is the case for updating the connection address?
|
|
||
| // AcceptConnection accepts a connection and then closes a listener. | ||
| // It monitors ctx.Done() and uvm.Wait() for early termination. | ||
| func AcceptConnection(ctx context.Context, uvm vmmanager.LifetimeManager, l net.Listener, closeConnection bool) (net.Conn, error) { |
Contributor
There was a problem hiding this comment.
To make this layer more testable do we need the connection be be given to the guest manager? Like leave this as the framing layer and the actual transport part is separate than this interface? Or is there a reason the guest manager needs to have connection management?
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.
This pull request introduces a new guest-side management layer for virtual machines (VMs), clearly separating guest operations from host-side management and configuration. It does so by defining new interfaces and concrete implementations for interacting with the guest via the Guest Compute Service (GCS).
Note This PR is dependent upon #2597
The most important changes are:
Guest Manager Interface and Implementation:
GuestOpsinterface ininternal/vm/guest.go, which defines APIs for establishing a GCS connection and performing guest-side operations (network, storage, device, security policy, etc.). This interface is the contract for guest management.guestManagerimplementation ofGuestOpsininternal/vm/guestmanager/hcs.go, which manages the GCS connection lifecycle, applies configuration options, and exposes guest-side management interfaces.Guest Resource Management Implementations:
GuestNetworkManager) ininternal/vm/guestmanager/network.goDirectoryManager) ininternal/vm/guestmanager/mapped_directory.goLayersManager) ininternal/vm/guestmanager/combinedlayers.goGuestDeviceManager) ininternal/vm/guestmanager/device.goBlockCIMsManager) ininternal/vm/guestmanager/block_cims.goThis refactor lays a foundation for clean separation between host and guest responsibilities.