Skip to content

Commit aff3d2b

Browse files
committed
resolve comments for pr
Signed-off-by: Amory Hoste <[email protected]>
1 parent 63f16b2 commit aff3d2b

File tree

3 files changed

+88
-85
lines changed

3 files changed

+88
-85
lines changed

proto/types.pb.go

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

proto/types.proto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ message IPConfiguration {
9898
message FirecrackerMachineConfiguration {
9999
string CPUTemplate = 1; // Specifies the cpu template. Example: "T2" or "C3"
100100
bool HtEnabled = 2; // Specifies if hyper-threading should be enabled
101-
bool TrackDirtyPages = 3; // Specified if dirty-page-tracking should be enabled.
102101
// Specifies the memory size of VM
103102
// This lets us create a Firecracker VM of up to 4096 TiB, which
104103
// for a microVM should be large enough
105-
uint32 MemSizeMib = 4;
106-
uint32 VcpuCount = 5; // Specifies the number of vCPUs for the VM
104+
uint32 MemSizeMib = 3;
105+
uint32 VcpuCount = 4; // Specifies the number of vCPUs for the VM
106+
bool TrackDirtyPages = 5; // Specified if dirty-page-tracking should be enabled.
107+
107108
}
108109

109110
// Message to specify the block device config for a Firecracker VM

runtime/service.go

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,24 @@ func (s *service) startEventForwarders(remotePublisher shim.Publisher) {
274274
go func() {
275275
<-s.vmReady
276276

277-
if ! s.snapLoaded {
278-
// Once the VM is ready, also start forwarding events from it to our exchange
279-
attachCh := eventbridge.Attach(ctx, s.eventBridgeClient, s.eventExchange)
277+
if s.snapLoaded {
278+
return
279+
}
280280

281-
err := <-attachCh
282-
if err != nil && err != context.Canceled && !strings.Contains(err.Error(), "context canceled") {
283-
s.logger.WithError(err).Error("error while forwarding events from VM agent")
284-
}
281+
// Once the VM is ready, also start forwarding events from it to our exchange
282+
attachCh := eventbridge.Attach(ctx, s.eventBridgeClient, s.eventExchange)
285283

286-
err = <-republishCh
287-
if err != nil && err != context.Canceled {
288-
s.logger.WithError(err).Error("error while republishing events")
289-
}
284+
err := <-attachCh
285+
if err != nil && err != context.Canceled && !strings.Contains(err.Error(), "context canceled") {
286+
s.logger.WithError(err).Error("error while forwarding events from VM agent")
287+
}
290288

291-
remotePublisher.Close()
289+
err = <-republishCh
290+
if err != nil && err != context.Canceled {
291+
s.logger.WithError(err).Error("error while republishing events")
292292
}
293+
294+
remotePublisher.Close()
293295
}()
294296
}
295297

@@ -736,7 +738,7 @@ func (s *service) StopVM(requestCtx context.Context, request *proto.StopVMReques
736738

737739
// shutdownSnapLoadedVm shuts down a vm that has been loaded from a snapshot
738740
func (s *service) shutdownSnapLoadedVm() error {
739-
// Kill firecracker process and its shild processes
741+
// Kill firecracker process and its child processes
740742
if err := syscall.Kill(-s.firecrackerPid, 9); err != nil {
741743
s.logger.WithError(err).Error("Failed to kill firecracker process")
742744
return err
@@ -1799,9 +1801,9 @@ func (s *service) monitorVMExit() {
17991801

18001802
func (s *service) createHTTPControlClient() {
18011803
u := &httpunix.Transport{
1802-
DialTimeout: 1000 * time.Millisecond,
1803-
RequestTimeout: 60 * time.Second,
1804-
ResponseHeaderTimeout: 60 * time.Second,
1804+
DialTimeout: 500 * time.Millisecond,
1805+
RequestTimeout: 15 * time.Second,
1806+
ResponseHeaderTimeout: 15 * time.Second,
18051807
}
18061808
u.RegisterLocation("firecracker", s.shimDir.FirecrackerSockPath())
18071809

@@ -2178,7 +2180,7 @@ func (s *service) SendCreateSnapRequest(createSnapReq *http.Request) error {
21782180
}
21792181

21802182
// Offload Shuts down a VM and deletes the corresponding firecracker socket
2181-
// and vsock. All of the other resources will persist. Depracated!
2183+
// and vsock. All of the other resources will persist. DEPRECATED!
21822184
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
21832185

21842186
if !s.snapLoaded {

0 commit comments

Comments
 (0)