mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-15 13:58:55 +00:00
runtime: log vm start error before cleanup
Return of proper error to the initiator is not guaranteed. Method StopVM could kill shim process together with VM pieces. Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
This commit is contained in:
@@ -1458,6 +1458,8 @@ func (s *Sandbox) startVM(ctx context.Context, prestartHookFunc func(context.Con
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// Log error, otherwise nobody might see it - StopVM could kill this process.
|
||||
s.Logger().WithError(err).Error("Cannot start VM")
|
||||
s.hypervisor.StopVM(ctx, false)
|
||||
}
|
||||
}()
|
||||
|
Reference in New Issue
Block a user