Refactor GCS logging and guest management for reusability#2612
Open
rawahars wants to merge 7 commits intomicrosoft:mainfrom
Open
Refactor GCS logging and guest management for reusability#2612rawahars wants to merge 7 commits intomicrosoft:mainfrom
rawahars wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
WaitSandbox API expects the exit code and exit timestamp in it's response. Therefore, adding and capturing the same to the actual compute system struct. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
There were few issues in the initial draft of guest manager code- - Guest connection listener was created during New method and then used in CreateConnection. This can be simplified by creating the listener prior to start accepting connections on the same. - Instead of hardcoding the GCS Service GUID, it can be made into a configurable parameter so that it can be used across shims. - Updation of HvSocket was needed only for WCOW and hence that responsibility can be deferred to the caller and hence hvSocket API was introduced. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
AcceptConnection method was incorrectly part of guestmanager package. Moreover, we needed stop time in SandboxWait API and hence the same is added to the manager. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Start time is needed to be returned in the StartSandbox API and SandboxStatus API. Therefore, we need the plumbing for the same. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
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 refactors the handling of LCOW utility VM constants, device type validation, and related utility functions. The main goal is to centralize constants and helper functions into a new
vmutilspackage, which improves code maintainability and consistency.Additionally, it introduces a
StoppedTimemethod to theSystemstruct. This will be used inSandboxWaitAPI response.The most important changes are:
Centralization of Constants and Utility Functions
Moved various LCOW boot file names (e.g.,
KernelFile,InitrdFile,VhdFile, etc.), default values (e.g.,DefaultVPMEMCount,DefaultVPMemSizeBytes), and error variables (e.g.,ErrCPUGroupCreateNotSupported) from theuvmpackage to a newvmutilspackage. Updated all references throughout the codebase to use the new locations.Centralized the device type validation function by moving
IsValidDeviceTypefrom theuvmpackage tovmutils, and updated all usages accordingly.Refactoring and Type Improvements
OptionsLCOWstruct to usevmutils.OutputHandlerCreatorfor output handling, and updated default assignments to usevmutils.ParseGCSLogrus.System Lifecycle Tracking
stopTimefield and aStoppedTime()method to theSystemstruct ininternal/hcs/system.goto record and expose the time when a system stops.