mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-08 20:29:11 +00:00
runtime: Fix logging on virtiofs shutdown
Fixes a confusing log message shown when Virtio-FS is disabled. Previously we logged “The virtiofsd had stopped” regardless of whether Virtio-FS was actually enabled or not. Signed-off-by: Paweł Bęza <pawel.beza99@gmail.com>
This commit is contained in:
@@ -726,7 +726,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")
|
||||
}
|
||||
@@ -1303,10 +1307,12 @@ func (clh *cloudHypervisor) terminate(ctx context.Context, waitOnly bool) (err e
|
||||
return err
|
||||
}
|
||||
|
||||
clh.Logger().Debug("stop virtiofsDaemon")
|
||||
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")
|
||||
if err = clh.stopVirtiofsDaemon(ctx); err != nil {
|
||||
clh.Logger().WithError(err).Error("failed to stop virtiofsDaemon")
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user