Skip to content

Commit ffdaba4

Browse files
committed
*Updated Firecracker and return PID
*Removed patch drive from LoadSnapshot *Now return the Firecracker PID in CreateVM's and LoadSnapshot's reponse *Now return the path to the UPF socket in CreateVM instead of Offload Signed-off-by: Plamen Petrov <[email protected]>
1 parent 82029dc commit ffdaba4

File tree

9 files changed

+162
-53
lines changed

9 files changed

+162
-53
lines changed

_submodules/firecracker

Submodule firecracker updated 153 files

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) (*empty.Empty, error) {
655+
func (s *local) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadResponse, 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) (*proto.OffloadResponse, error) {
675+
func (s *local) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, 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) (*empty.Empty, error) {
130+
func (s *service) LoadSnapshot(ctx context.Context, req *proto.LoadSnapshotRequest) (*proto.LoadResponse, 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) (*proto.OffloadResponse, error) {
140+
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
141141
log.G(ctx).Debugf("offload request: %+v", req)
142142
return s.local.Offload(ctx, req)
143143
}

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,8 @@ golang.org/x/tools v0.0.0-20200708183856-df98bc6d456c h1:Jt8nybBNSGn80qEV8fQLwCa
10841084
golang.org/x/tools v0.0.0-20200708183856-df98bc6d456c/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
10851085
golang.org/x/tools v0.0.0-20200710042808-f1c4188a97a1 h1:rD1FcWVsRaMY+l8biE9jbWP5MS/CJJ/90a9TMkMgNrM=
10861086
golang.org/x/tools v0.0.0-20200710042808-f1c4188a97a1/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
1087+
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d h1:szSOL78iTCl0LF1AMjhSWJj8tIM0KixlUUnBtYXsmd8=
1088+
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
10871089
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10881090
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10891091
<<<<<<< HEAD

proto/firecracker.pb.go

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

proto/firecracker.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ message CreateVMResponse {
4949
string LogFifoPath = 3;
5050
string MetricsFifoPath = 4;
5151
string CgroupPath = 5;
52+
string UPFSockPath = 6;
53+
string FirecrackerPID = 7;
5254
}
5355

5456
message PauseVMRequest {
@@ -116,8 +118,8 @@ message LoadSnapshotRequest {
116118
bool EnableUserPF = 4;
117119
}
118120

119-
message OffloadResponse {
120-
string SendSockPath = 1;
121+
message LoadResponse {
122+
string FirecrackerPID = 1;
121123
}
122124

123125
message OffloadRequest {

proto/service/fccontrol/fccontrol.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,13 @@ service Firecracker {
4242

4343
// Updates a balloon device statistics polling interval.
4444
rpc UpdateBalloonStats(UpdateBalloonStatsRequest) returns(google.protobuf.Empty);
45+
46+
// Loads VM from snapshot
47+
rpc LoadSnapshot(LoadSnapshotRequest) returns (LoadResponse);
48+
49+
// Make a snapshot of a VM
50+
rpc CreateSnapshot(CreateSnapshotRequest) returns (google.protobuf.Empty);
51+
52+
// Offload a snapshotted VM
53+
rpc Offload(OffloadRequest) returns (google.protobuf.Empty);
4554
}

0 commit comments

Comments
 (0)