Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

vsock: passthrough fd support for hybrid mode #278

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

lifupan
Copy link

@lifupan lifupan commented May 16, 2023

After applying this commit, the hybrid vsock would support two types of connections:

  1. pass "CONNECT \n" to the hybrid unix socket; 2) pass "PASSFD\n" to the hybrid unix socket first,
    then, using sendmsg and msg_control to pass the
    number and fd to the unix socket.

In both of the cases, you should read on the socket to get a response of "OK <assigned_hostside_port>\n".

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #278 (048b3a9) into main (7cb8457) will decrease coverage by 0.40%.
The diff coverage is 34.02%.

❗ Current head 048b3a9 differs from pull request most recent head 0c84793. Consider uploading reports for the commit 0c84793 to get more accurate results

@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
- Coverage   90.42%   90.02%   -0.40%     
==========================================
  Files          82       80       -2     
  Lines       24596    23822     -774     
==========================================
- Hits        22240    21445     -795     
- Misses       2356     2377      +21     
Flag Coverage Δ
dbs-address-space 95.30% <ø> (ø)
dbs-allocator ?
dbs-arch 96.37% <ø> (ø)
dbs-boot 94.90% <ø> (ø)
dbs-device 92.95% <ø> (ø)
dbs-interrupt 90.42% <ø> (ø)
dbs-legacy-devices 92.77% <ø> (ø)
dbs-miniball ∅ <ø> (∅)
dbs-upcall 94.31% <ø> (ø)
dbs-utils 91.25% <ø> (ø)
dbs-virtio-devices 86.91% <34.02%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/dbs-address-space/src/lib.rs 100.00% <ø> (ø)
crates/dbs-arch/src/lib.rs 100.00% <ø> (ø)
crates/dbs-boot/src/lib.rs 100.00% <ø> (ø)
crates/dbs-device/src/lib.rs 92.92% <ø> (ø)
crates/dbs-interrupt/src/lib.rs 54.28% <ø> (ø)
crates/dbs-legacy-devices/src/lib.rs 100.00% <ø> (ø)
crates/dbs-upcall/src/lib.rs 97.92% <ø> (ø)
crates/dbs-utils/src/lib.rs 100.00% <ø> (ø)
crates/dbs-virtio-devices/src/lib.rs 95.30% <ø> (ø)
crates/dbs-virtio-devices/src/vsock/backend/mod.rs 5.88% <0.00%> (-4.12%) ⬇️
... and 3 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wllenyj
Copy link
Contributor

wllenyj commented May 16, 2023

@lifupan Can you fix the clippy?

@lifupan
Copy link
Author

lifupan commented May 16, 2023

@lifupan Can you fix the clippy?

Done!

@lifupan lifupan force-pushed the main branch 2 times, most recently from 048b3a9 to 3801bea Compare July 7, 2023 03:50
@lifupan lifupan force-pushed the main branch 2 times, most recently from b894667 to 49b6bcc Compare July 12, 2023 23:51
After applying this commit, the hybrid vsock would support two
types of connections:

1) pass "CONNECT <port>\n" to the hybrid unix socket;
2) pass "PASSFD\n" to the hybrid unix socket first,
   then, using sendmsg and msg_control to pass the <port>
   number and fd to the unix socket.

In both of the cases, you should read on the socket to
get a response of "OK <assigned_hostside_port>\n".

Signed-off-by: fupan <[email protected]>
Copy link
Collaborator

@ZizhengBian ZizhengBian left a comment

Choose a reason for hiding this comment

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

LGTM

@studychao studychao merged commit d30406b into openanolis:main Jul 17, 2023
30 of 31 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants