mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-13 15:14:08 +00:00
Merge pull request #11359 from pawelbeza/fix-logs-on-virtiofs-shutdown
Fix logging on virtiofs shutdown
This commit is contained in:
commit
9b4518f742
@ -729,7 +729,11 @@ func (clh *cloudHypervisor) StartVM(ctx context.Context, timeout int) error {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if clh.config.SharedFS == config.VirtioFS || clh.config.SharedFS == config.VirtioFSNydus {
|
||||
if shutdownErr := clh.stopVirtiofsDaemon(ctx); shutdownErr != nil {
|
||||
clh.Logger().WithError(shutdownErr).Warn("error shutting down VirtiofsDaemon")
|
||||
}
|
||||
@ -1306,11 +1310,13 @@ func (clh *cloudHypervisor) terminate(ctx context.Context, waitOnly bool) (err e
|
||||
return err
|
||||
}
|
||||
|
||||
if clh.config.SharedFS == config.VirtioFS || clh.config.SharedFS == config.VirtioFSNydus {
|
||||
clh.Logger().Debug("stop virtiofsDaemon")
|
||||
|
||||
if err = clh.stopVirtiofsDaemon(ctx); err != nil {
|
||||
clh.Logger().WithError(err).Error("failed to stop virtiofsDaemon")
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user