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 <eguan@linux.alibaba.com>
This commit is contained in:
Eryu Guan 2019-08-06 10:53:23 +08:00
parent 00e0aaa6e4
commit a9168a3fc9

View File

@ -658,6 +658,8 @@ func (q *qemu) setupVirtiofsd(timeout int) (remain int, err error) {
} }
} }
q.Logger().Info("virtiofsd quits") q.Logger().Info("virtiofsd quits")
// Wait to release resources of virtiofsd process
cmd.Process.Wait()
q.stopSandbox() q.stopSandbox()
}() }()