File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ type Machine struct {
173173 startOnce sync.Once
174174 // exitCh is a channel which gets closed when the VMM exits
175175 exitCh chan struct {}
176- // err records any error executing the VMM
177- err error
176+ // fatalErr records an error that either stops or prevent starting the VMM
177+ fatalErr error
178178
179179 // callbacks that should be run when the machine is being torn down
180180 cleanupOnce sync.Once
@@ -349,7 +349,7 @@ func (m *Machine) Wait(ctx context.Context) error {
349349 case <- ctx .Done ():
350350 return ctx .Err ()
351351 case <- m .exitCh :
352- return m .err
352+ return m .fatalErr
353353 }
354354}
355355
@@ -444,7 +444,7 @@ func (m *Machine) startVMM(ctx context.Context) error {
444444 if err != nil {
445445 m .logger .Errorf ("Failed to start VMM: %s" , err )
446446
447- m .err = err
447+ m .fatalErr = err
448448 close (m .exitCh )
449449
450450 return err
@@ -501,17 +501,17 @@ func (m *Machine) startVMM(ctx context.Context) error {
501501 err = m .waitForSocket (3 * time .Second , errCh )
502502 if err != nil {
503503 err = errors .Wrapf (err , "Firecracker did not create API socket %s" , m .Cfg .SocketPath )
504- m .err = err
504+ m .fatalErr = err
505505 close (m .exitCh )
506506
507507 return err
508508 }
509509 go func () {
510510 select {
511511 case <- ctx .Done ():
512- m .err = ctx .Err ()
512+ m .fatalErr = ctx .Err ()
513513 case err := <- errCh :
514- m .err = err
514+ m .fatalErr = err
515515 }
516516
517517 signal .Stop (sigchan )
You can’t perform that action at this time.
0 commit comments