Skip to content

Commit 28f2fe2

Browse files
authored
firecracker: clean up unused externalJailerCmd (#4865)
1 parent fe1dc17 commit 28f2fe2

File tree

1 file changed

+2
-14
lines changed
  • enterprise/server/remote_execution/containers/firecracker

1 file changed

+2
-14
lines changed

enterprise/server/remote_execution/containers/firecracker/firecracker.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,6 @@ type FirecrackerContainer struct {
405405
createFromSnapshot bool
406406
mountWorkspaceFile bool
407407

408-
// If a container is resumed from a snapshot, the jailer
409-
// is started first using an external command and then the snapshot
410-
// is loaded. This slightly breaks the firecracker SDK's "Wait()"
411-
// method, so in that case we wait for the external jailer command
412-
// to finish, rather than calling "Wait()" on the sdk machine object.
413-
externalJailerCmd *exec.Cmd
414-
415408
cleanupVethPair func(context.Context) error
416409
// cancelVmCtx cancels the Machine context, stopping the VMM if it hasn't
417410
// already been stopped manually.
@@ -1063,10 +1056,6 @@ func nonCmdExit(ctx context.Context, err error) *interfaces.CommandResult {
10631056
}
10641057
}
10651058

1066-
func (c *FirecrackerContainer) startedFromSnapshot() bool {
1067-
return c.externalJailerCmd != nil
1068-
}
1069-
10701059
func (c *FirecrackerContainer) newID(ctx context.Context) error {
10711060
vmIdxMu.Lock()
10721061
defer vmIdxMu.Unlock()
@@ -2200,9 +2189,8 @@ func (c *FirecrackerContainer) syncWorkspace(ctx context.Context) error {
22002189
func (c *FirecrackerContainer) Wait(ctx context.Context) error {
22012190
ctx, span := tracing.StartSpan(ctx)
22022191
defer span.End()
2203-
2204-
if c.externalJailerCmd != nil {
2205-
return c.externalJailerCmd.Wait()
2192+
if c.machine == nil {
2193+
return nil
22062194
}
22072195
return c.machine.Wait(ctx)
22082196
}

0 commit comments

Comments
 (0)