Skip to content

Commit 3e6919b

Browse files
committed
Offload returns UPF socket
As opposed to load snapshots. This is because the socket is needed for LoadSnapshot and needs to be available before it is called Signed-off-by: Plamen Petrov <[email protected]>
1 parent e3af66c commit 3e6919b

File tree

5 files changed

+127
-24
lines changed

5 files changed

+127
-24
lines changed

firecracker-control/local.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ func (s *local) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotReq
652652
}
653653

654654
// LoadSnapshot Loads a snapshot of a VM
655-
func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadSnapshotResponse, error) {
655+
func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*empty.Empty, error) {
656656
client, err := s.shimFirecrackerClient(ctx, req.VMID)
657657
if err != nil {
658658
return nil, err
@@ -672,7 +672,7 @@ func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest
672672
// Offload Shuts down a VM started through the firecracker go sdk and deletes
673673
// the corresponding firecracker socket. All of the other resources (shim, other sockets)
674674
// will persist.
675-
func (s *local) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
675+
func (s *local) Offload(ctx context.Context, req *proto.OffloadRequest) (*proto.OffloadResponse, error) {
676676
client, err := s.shimFirecrackerClient(ctx, req.VMID)
677677
if err != nil {
678678
return nil, err

firecracker-control/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *service) UpdateBalloonStats(ctx context.Context, req *proto.UpdateBallo
127127
return s.local.UpdateBalloonStats(ctx, req)
128128
}
129129

130-
func (s *service) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadSnapshotResponse, error) {
130+
func (s *service) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*empty.Empty, error) {
131131
log.G(ctx).Debugf("load snapshot request: %+v", req)
132132
return s.local.LoadSnapshot(ctx, req)
133133
}
@@ -137,7 +137,7 @@ func (s *service) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotR
137137
return s.local.CreateSnapshot(ctx, req)
138138
}
139139

140-
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
140+
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*proto.OffloadResponse, error) {
141141
log.G(ctx).Debugf("offload request: %+v", req)
142142
return s.local.Offload(ctx, req)
143143
}

proto/firecracker.pb.go

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

proto/firecracker.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ message LoadSnapshotRequest {
116116
bool EnableUserPF = 4;
117117
}
118118

119-
message LoadSnapshotResponse {
119+
message OffloadResponse {
120120
string SendSockPath = 1;
121121
}
122122

proto/service/fccontrol/ttrpc/fccontrol.pb.go

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

0 commit comments

Comments
 (0)