Skip to content

Commit

Permalink
add compatibility with offloading
Browse files Browse the repository at this point in the history
Signed-off-by: Amory Hoste <[email protected]>
  • Loading branch information
amohoste committed Jan 23, 2022
1 parent aff3d2b commit 032bd10
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 104 deletions.
10 changes: 6 additions & 4 deletions firecracker-control/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,12 @@ func (s *local) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotReq
func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadResponse, error) {
var err error

// Create shim if not exists yet
code, err := s.CreateShim(ctx, req.GetVMID())
if err != nil && code != codes.AlreadyExists {
return nil, err
// Create shim if not exists yet for non-offloaded snapshots
if ! req.Offloaded {
code, err := s.CreateShim(ctx, req.GetVMID())
if err != nil && code != codes.AlreadyExists {
return nil, err
}
}

client, err := s.shimFirecrackerClient(ctx, req.VMID)
Expand Down
2 changes: 1 addition & 1 deletion proto/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 90 additions & 72 deletions proto/firecracker.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions proto/firecracker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ message CreateVMRequest {
FirecrackerBalloonDevice BalloonDevice = 14;

string NetworkNamespace = 15;
bool OffloadEnabled = 16;
}

message CreateVMResponse {
Expand Down Expand Up @@ -121,6 +122,7 @@ message LoadSnapshotRequest {
bool EnableUserPF = 4;
string NetworkNamespace = 5;
string NewSnapshotPath = 6;
bool Offloaded = 7;
}

message LoadResponse {
Expand Down
Loading

0 comments on commit 032bd10

Please sign in to comment.