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 <manohar.r.castelino@intel.com>
This commit is contained in:
Manohar Castelino 2018-12-18 22:15:22 -08:00
parent e65bafa793
commit 22ebc09f00

View File

@ -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
}