mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-14 15:44:58 +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
|
return err
|
||||||
}
|
}
|
||||||
defer func() {
|
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 {
|
if shutdownErr := clh.stopVirtiofsDaemon(ctx); shutdownErr != nil {
|
||||||
clh.Logger().WithError(shutdownErr).Warn("error shutting down VirtiofsDaemon")
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if clh.config.SharedFS == config.VirtioFS || clh.config.SharedFS == config.VirtioFSNydus {
|
||||||
clh.Logger().Debug("stop virtiofsDaemon")
|
clh.Logger().Debug("stop virtiofsDaemon")
|
||||||
|
|
||||||
if err = clh.stopVirtiofsDaemon(ctx); err != nil {
|
if err = clh.stopVirtiofsDaemon(ctx); err != nil {
|
||||||
clh.Logger().WithError(err).Error("failed to stop virtiofsDaemon")
|
clh.Logger().WithError(err).Error("failed to stop virtiofsDaemon")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user