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 <bin@hyper.sh>
This commit is contained in:
bin 2021-12-07 16:06:26 +08:00
parent f42c7d5125
commit 271d67a831

View File

@ -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