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 {
173
173
startOnce sync.Once
174
174
// exitCh is a channel which gets closed when the VMM exits
175
175
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
178
178
179
179
// callbacks that should be run when the machine is being torn down
180
180
cleanupOnce sync.Once
@@ -349,7 +349,7 @@ func (m *Machine) Wait(ctx context.Context) error {
349
349
case <- ctx .Done ():
350
350
return ctx .Err ()
351
351
case <- m .exitCh :
352
- return m .err
352
+ return m .fatalErr
353
353
}
354
354
}
355
355
@@ -444,7 +444,7 @@ func (m *Machine) startVMM(ctx context.Context) error {
444
444
if err != nil {
445
445
m .logger .Errorf ("Failed to start VMM: %s" , err )
446
446
447
- m .err = err
447
+ m .fatalErr = err
448
448
close (m .exitCh )
449
449
450
450
return err
@@ -501,17 +501,17 @@ func (m *Machine) startVMM(ctx context.Context) error {
501
501
err = m .waitForSocket (3 * time .Second , errCh )
502
502
if err != nil {
503
503
err = errors .Wrapf (err , "Firecracker did not create API socket %s" , m .Cfg .SocketPath )
504
- m .err = err
504
+ m .fatalErr = err
505
505
close (m .exitCh )
506
506
507
507
return err
508
508
}
509
509
go func () {
510
510
select {
511
511
case <- ctx .Done ():
512
- m .err = ctx .Err ()
512
+ m .fatalErr = ctx .Err ()
513
513
case err := <- errCh :
514
- m .err = err
514
+ m .fatalErr = err
515
515
}
516
516
517
517
signal .Stop (sigchan )
You can’t perform that action at this time.
0 commit comments