-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vfkit support #231
Add vfkit support #231
Conversation
The corresponding vfkit code can be found in https://github.com/cfergeau/vfkit/tree/gvproxy |
@@ -101,6 +105,18 @@ func main() { | |||
exitWithError(errors.Errorf("%q already exists", uri.Path)) | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all other sockets compare to ""
to determine empty. why length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blocks just above if len(vfkitSocket) > 0 { ... }
are if len(qemuSocket) > 0 { ... }
and if len(bessSocket) > 0 { ... }
.
There are ""
comparisons after this block but for a different purpose (error checks for conflicting options) which I forgot to add to this PR, I'll do this.
@@ -124,6 +140,9 @@ func main() { | |||
if bessSocket != "" { | |||
protocol = types.BessProtocol | |||
} | |||
if vfkitSocket != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems it can be combined with previous check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a very basic approach, and added an additional block where there were pre-existing references to qemuSocket
and bessSocket
. All of this could probably be refactored/simplified, but I haven't thought about it.
Communication must happen over a connected datagram unix socket. This reuses most of the work which was done for bess. Since there is no 'accept' with unixgram sockets which could be used to get the address to send the data back to (ie the VM address), this adds a handshake between the VM and gvproxy: - gvproxy listens on a unixgram socket at a known location - vfkit connects to this location - vfkit sends "VFKT" - gvproxy receives this message and gets the VM address from it - network traffic can now happen between gvproxy and vfkit Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
It defines multiple protocols, not just one. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude, cfergeau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Communication must happen over a connected datagram unix socket. This
reuses most of the work which was done for bess.
Since there is no 'accept' with unixgram sockets which could be used to
get the address to send the data back to (ie the VM address), this adds
a handshake between the VM and gvproxy: