Skip to content

Simplify the host's networking cleanup#2697

Merged
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:simplify-host-cleanup
Jan 25, 2023
Merged

Simplify the host's networking cleanup#2697
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:simplify-host-cleanup

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Jan 25, 2023

This changes the host's net_ns: RefCell<Option<NetworkNamespace>> to net_ns: NetworkNamespace by adding a NetworkNamespace::cleanup function that has to be run while the worker has an active host. The network namespace objects have also been wrapped in a RefCell. The network interface objects don't have any &mut methods so this RefCell isn't currently needed, but we'll likely want to give them &mut methods in the future.

@robgjansen This can be merged either before or after your changes, whichever makes it easier for your PR.

@stevenengler stevenengler self-assigned this Jan 25, 2023
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Jan 25, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 25, 2023

Codecov Report

Base: 68.09% // Head: 67.46% // Decreases project coverage by -0.63% ⚠️

Coverage data is based on head (2348adc) compared to base (9021081).
Patch coverage: 82.05% of modified lines in pull request are covered.

❗ Current head 2348adc differs from pull request most recent head b280dba. Consider uploading reports for the commit b280dba to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2697      +/-   ##
==========================================
- Coverage   68.09%   67.46%   -0.63%     
==========================================
  Files         202      202              
  Lines       30388    30391       +3     
  Branches     5930     5933       +3     
==========================================
- Hits        20693    20504     -189     
- Misses       5001     5224     +223     
+ Partials     4694     4663      -31     
Flag Coverage Δ
tests 67.46% <82.05%> (-0.63%) ⬇️

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

Impacted Files Coverage Δ
src/main/host/descriptor/socket/inet/mod.rs 28.12% <0.00%> (ø)
src/main/network/net_namespace.rs 83.18% <76.00%> (-2.68%) ⬇️
src/main/host/host.rs 80.00% <100.00%> (-0.68%) ⬇️
src/main/host/network_interface.rs 76.92% <100.00%> (ø)
src/main/utility/mod.rs 54.34% <100.00%> (+1.01%) ⬆️
src/main/host/syscall/handler/eventfd.rs 0.00% <0.00%> (-68.43%) ⬇️
src/main/host/descriptor/eventfd.rs 0.00% <0.00%> (-65.66%) ⬇️
src/main/host/syscall/handler/fcntl.rs 47.29% <0.00%> (-17.57%) ⬇️
src/main/host/syscall/handler/ioctl.rs 40.00% <0.00%> (-17.15%) ⬇️
src/main/host/syscall/handler/unistd.rs 57.25% <0.00%> (-15.30%) ⬇️
... and 20 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stevenengler stevenengler force-pushed the simplify-host-cleanup branch from 2348adc to b280dba Compare January 25, 2023 21:16
@stevenengler stevenengler merged commit c8d6c68 into shadow:main Jan 25, 2023
@stevenengler stevenengler deleted the simplify-host-cleanup branch January 25, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants