From 22ebc09f001ccbdabc5444eae3ffe7f1f6050c1a Mon Sep 17 00:00:00 2001 From: Manohar Castelino Date: Tue, 18 Dec 2018 22:15:22 -0800 Subject: [PATCH] firecracker: Close the vsock vhostfd Unlike QEMU firecracker cannot accept a fd as part of the REST API. Close the vsock vhostfd close to the point where we launch the VM. Note: This is still racy. Signed-off-by: Manohar Castelino --- virtcontainers/fc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virtcontainers/fc.go b/virtcontainers/fc.go index 099ab828c8..a6c9a4119c 100644 --- a/virtcontainers/fc.go +++ b/virtcontainers/fc.go @@ -462,6 +462,10 @@ func (fc *firecracker) fcAddVsock(vs kataVSOCK) error { if err != nil { return err } + //Still racy. There is no way to send an fd to the firecracker + //REST API. We could release this just before we start the instance + //but even that will not eliminate the race + vs.vhostFd.Close() return nil }