From 271d67a831a422fe76af945f24bca8e8ba99d710 Mon Sep 17 00:00:00 2001 From: bin Date: Tue, 7 Dec 2021 16:06:26 +0800 Subject: [PATCH] runtime: only call stopVirtiofsd when shared_fs is virtio-fs If shared_fs is set to virtio-9p, the virtiofsd is not started, so there is no need to stop it. Fixes: #3219 Signed-off-by: bin --- src/runtime/virtcontainers/qemu.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index e3e6ade866..a58aec8a08 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -992,8 +992,10 @@ func (q *qemu) StopVM(ctx context.Context, waitOnly bool) error { } } - if err := q.stopVirtiofsd(ctx); err != nil { - return err + if q.config.SharedFS == config.VirtioFS { + if err := q.stopVirtiofsd(ctx); err != nil { + return err + } } return nil