Skip to content

Commit 0e94206

Browse files
committed
add compatibility with offloading
Signed-off-by: Amory Hoste <[email protected]>
1 parent aff3d2b commit 0e94206

File tree

5 files changed

+121
-103
lines changed

5 files changed

+121
-103
lines changed

firecracker-control/local.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,12 @@ func (s *local) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotReq
633633
func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadResponse, error) {
634634
var err error
635635

636-
// Create shim if not exists yet
637-
code, err := s.CreateShim(ctx, req.GetVMID())
638-
if err != nil && code != codes.AlreadyExists {
639-
return nil, err
636+
// Create shim if not exists yet for non-offloaded snapshots
637+
if ! req.Offloaded {
638+
code, err := s.CreateShim(ctx, req.GetVMID())
639+
if err != nil && code != codes.AlreadyExists {
640+
return nil, err
641+
}
640642
}
641643

642644
client, err := s.shimFirecrackerClient(ctx, req.VMID)

proto/events.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/firecracker.pb.go

Lines changed: 90 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/firecracker.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ message CreateVMRequest {
4343
FirecrackerBalloonDevice BalloonDevice = 14;
4444

4545
string NetworkNamespace = 15;
46+
bool OffloadEnabled = 16;
4647
}
4748

4849
message CreateVMResponse {
@@ -121,6 +122,7 @@ message LoadSnapshotRequest {
121122
bool EnableUserPF = 4;
122123
string NetworkNamespace = 5;
123124
string NewSnapshotPath = 6;
125+
bool Offloaded = 7;
124126
}
125127

126128
message LoadResponse {

0 commit comments

Comments
 (0)