From a9168a3fc9a4c70f698bb0aa110bd30654ac22f4 Mon Sep 17 00:00:00 2001 From: Eryu Guan Date: Tue, 6 Aug 2019 10:53:23 +0800 Subject: [PATCH] virtiofs: wait for virtiofsd process to release its resources We start virtiofsd in foreground (-f option), so we should wait for it to reclaim its resources to avoid zombie process when qemu or virtiofsd got killed unexpectedly. Fixes: #1934 Signed-off-by: Eryu Guan --- virtcontainers/qemu.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index 60a6580475..e1e17be9a0 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -658,6 +658,8 @@ func (q *qemu) setupVirtiofsd(timeout int) (remain int, err error) { } } q.Logger().Info("virtiofsd quits") + // Wait to release resources of virtiofsd process + cmd.Process.Wait() q.stopSandbox() }()