cache: Call vm.Disconnect() when close vm

After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: #1726

Signed-off-by: Hui Zhu <teawater@hyper.sh>
This commit is contained in:
Hui Zhu 2019-05-23 12:29:55 +08:00
parent 19115ef5f1
commit 7bf6c6754d

View File

@ -63,6 +63,7 @@ func New(ctx context.Context, count uint, b base.FactoryBase) base.FactoryBase {
case <-closed:
c.removeFromVmm(vm)
vm.Stop()
vm.Disconnect()
c.wg.Done()
return
}