Skip to content
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

virtionet: Add gvproxy support #50

Merged
merged 3 commits into from
Jul 10, 2023
Merged

virtionet: Add gvproxy support #50

merged 3 commits into from
Jul 10, 2023

Conversation

cfergeau
Copy link
Collaborator

@cfergeau cfergeau commented Jul 6, 2023

This fixes --device virtio-net,unixSocketPath= which was non-functional
until now, it was not using the correct socket type ("unix" instead of
"unixgram"). This commit fixes this. Immediately after
DialUnix("unixgram"), vfkit sends the magic string
"VFKT" so that the other end knows where to send the data to (there is no
Accept with unixgram sockets). There could be a better way but I'm not
aware of it.

@openshift-ci openshift-ci bot requested review from anjannath and baude July 6, 2023 15:47
cfergeau added 3 commits July 7, 2023 10:43
This fixes --device virtio-net,unixSocketPath= which was non-functional
until now, it was not using the correct socket type ("unix" instead of
"unixgram"). This commit fixes this.
Immediately after DialUnix("unixgram"), vfkit sends the magic string
"VFKT" so that the other end knows where to send the data to (there is
no `Accept` with unixgram sockets).
There could be a better way but I'm not aware of it.

This can be tested with gvproxy 0.6.2:

term1$ gvproxy  --listen unix:///tmp/gvproxy-http.sock --listen-vfkit unixgram:///tmp/gvproxy.sock
term2$ vfkit --device virtio-net,unixSocketPath=/tmp/gvproxy.sock,mac=5a:94:ef:e4:0c:ee [...]
Trying to prevent vf/virtio.go from getting too big.
Adds adhoc signal catching to remove the unix socket file vfkit created.
This should be moved to a higher level/made more generic/...
Copy link
Collaborator

@baude baude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot added the lgtm label Jul 7, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jul 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Jul 7, 2023
@cfergeau cfergeau merged commit b078d8a into crc-org:main Jul 10, 2023
@cfergeau cfergeau deleted the gvproxy branch July 10, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants