From 5c9e7a16c6e6422089956d2bb6c3410ce74c9b92 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 e631233cee..8dda9c0f8d 100644 --- a/virtcontainers/fc.go +++ b/virtcontainers/fc.go @@ -437,6 +437,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 }