Prevent use of socat in firecracker-pilot #41
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Do not shell out socat and use proper UnixListener/UnixStream to do this job. This version of the commit works but I stumbled across a few issues:
Permission denied when the UnixListener runs as user and the firecracker process was called as root (run_as: root in the flake). The former implementation ran socat via sudo in the same way as the firecracker process. Thus if you register the flake to run as root it can now also only be called as root, which is acceptable.
The behavior in interactive sessions differs compared to socat. When sci in the guest is called it creates a pty and all data is copied to the vsock stream. The host connects via an UDS socket to this data and we multiplex stdin->stream and stream->stdout. When doing this with socat the behavior is different in a way that e.g tabs are effectively interpreted and the pty prompt allows for input on the same line when my code now always needs a newline to renew the prompt. I did not debug further what is needed to make this look nicer.