Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
vc: Check error return from storeState
Browse files Browse the repository at this point in the history
Fixes #2324

This achieves parity with the check on line 293.

Signed-off-by: Ted Yu [email protected]
  • Loading branch information
yutedz committed Dec 6, 2019
1 parent 00ff99b commit 9a15457
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,17 @@ func (clh *cloudHypervisor) startSandbox(timeout int) error {
}
if err := clh.waitVMM(clhTimeout); err != nil {
clh.Logger().WithField("error", err).WithField("output", clh.cmdOutput.String()).Warn("cloud-hypervisor init failed")
clh.shutdownVirtiofsd()
if shutdownErr := clh.shutdownVirtiofsd(); shutdownErr != nil {
clh.Logger().WithField("error", shutdownErr).Warn("error shutting down Virtiofsd")
}
return err
}

clh.state.PID = pid
clh.state.state = clhReady
clh.storeState()
if err = clh.storeState(); err != nil {
return err
}

return nil
}
Expand Down

0 comments on commit 9a15457

Please sign in to comment.