[live-migration] adds the paths for enabling save/restore#2709
Open
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Open
[live-migration] adds the paths for enabling save/restore#2709rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
4b69bce to
abe57f8
Compare
Introduces the host-side primitives needed to snapshot in-flight
container state on the source and re-attach to it on the destination,
without disturbing the existing create paths.
- cow.Process: add IOPorts() to expose the host-side vsock ports
allocated for a process's stdio relay. Implemented on gcs.Process;
stubbed (returns zeros) on hcs.Process and jobcontainers.JobProcess.
- internal/gcs:
- Process records the stdin/stdout/stderr vsock ports allocated by
gc.exec, and Close tolerates nil io channels for streams not
opened on restore.
- Rename CloneContainer -> OpenContainer as the generic "attach to
an already-running container" entry point.
- Add Container.OpenProcessWithIO: restore-side counterpart of
CreateProcess that re-listens on the supplied vsock ports and
re-subscribes to the process exit notification.
- Add GuestConnection.NextPort / SetNextPort to snapshot and seed
the IO port allocator floor so restored processes don't collide
with newly-allocated ones.
- internal/cmd: add cmd.Attach, the destination-side counterpart of
Command/CommandContext that binds a Cmd to a caller-resolved
process and wires the IO relays. Relay wiring factored out of Start
into startRelay. Tests cover Attach lifetime and IO flow.
- internal/vm/guestmanager: add Guest.OpenContainer, NextPort and
SetNextPort wrappers over the underlying GCS connection.
- internal/vm/vmmanager: add UtilityVM.PropertiesV3 exposing the V3
HCS property query for the save path.
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
abe57f8 to
62083de
Compare
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
Introduces the host-side primitives needed to snapshot in-flight container state on the source and re-attach to it on the destination, without disturbing the existing create paths.
cow.Process: add IOPorts() to expose the host-side vsock ports allocated for a process's stdio relay. Implemented on gcs.Process; stubbed (returns zeros) on hcs.Process and jobcontainers.JobProcess.
internal/gcs:
internal/cmd: add cmd.Attach, the destination-side counterpart of Command/CommandContext that binds a Cmd to a caller-resolved process and wires the IO relays. Relay wiring factored out of Start into startRelay. Tests cover Attach lifetime and IO flow.
internal/vm/guestmanager: add Guest.OpenContainer, NextPort and SetNextPort wrappers over the underlying GCS connection.
internal/vm/vmmanager: add UtilityVM.PropertiesV3 exposing the V3 HCS property query for the save path.