From 9a15457064df10a396aedbbfaf5aec0fcbaacd5f Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Thu, 5 Dec 2019 18:55:41 -0800 Subject: [PATCH] vc: Check error return from storeState Fixes #2324 This achieves parity with the check on line 293. Signed-off-by: Ted Yu yuzhihong@gmail.com --- virtcontainers/clh.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/virtcontainers/clh.go b/virtcontainers/clh.go index bff50cfdb..f91b7d1bb 100644 --- a/virtcontainers/clh.go +++ b/virtcontainers/clh.go @@ -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 }