Skip to content

Conversation

ShadowCurse
Copy link
Contributor

Changes

  • Move vmm related parts of utils into vmm.
  • Remove reexport of vmm_sys_utils

Reason

utils crate contained a bunch of helper functions/structs, but most of them were only used by vmm crate, so the coupling between these 2 crates was very high. This created an issue where if we want to add some utility function/struct to use in vmm, we need to add it instead to the utils crate, because vmm by itself does not have utils module. (not including utilities which only contain testing code). By moving part of utils into vmm/utils we remove vmm dependency on utils and make it easier to add/modify utility functions/structs in vmm.
Additionally we can remove reexporting of vmm_sys_utils from both utils and vmm/utils. This helps with core readability as now there is only 1 place to import vmm_sys_utils items from: the vmm_sys_utils crate itself.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@ShadowCurse ShadowCurse force-pushed the move_utils branch 6 times, most recently from 35fb7e6 to 1d84cb9 Compare August 16, 2024 10:00
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.35%. Comparing base (c86a562) to head (33e07b9).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/vmm/src/utils/mod.rs 73.33% 4 Missing ⚠️
src/jailer/src/env.rs 0.00% 3 Missing ⚠️
src/jailer/src/main.rs 0.00% 2 Missing ⚠️
src/vmm/src/rpc_interface.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4730   +/-   ##
=======================================
  Coverage   84.34%   84.35%           
=======================================
  Files         249      249           
  Lines       27512    27504    -8     
=======================================
- Hits        23206    23200    -6     
+ Misses       4306     4304    -2     
Flag Coverage Δ
5.10-c5n.metal 84.57% <76.19%> (-0.01%) ⬇️
5.10-m5n.metal 84.55% <76.19%> (-0.01%) ⬇️
5.10-m6a.metal 83.84% <76.19%> (-0.01%) ⬇️
5.10-m6g.metal 80.93% <76.19%> (-0.01%) ⬇️
5.10-m6i.metal 84.54% <76.19%> (-0.01%) ⬇️
5.10-m7g.metal 80.93% <76.19%> (-0.01%) ⬇️
6.1-c5n.metal 84.57% <76.19%> (?)
6.1-m5n.metal 84.55% <76.19%> (?)
6.1-m6a.metal 83.84% <76.19%> (?)
6.1-m6g.metal 80.93% <76.19%> (?)
6.1-m6i.metal 84.55% <76.19%> (?)
6.1-m7g.metal 80.93% <76.19%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ShadowCurse ShadowCurse force-pushed the move_utils branch 4 times, most recently from 5943aee to 28ffa4d Compare August 22, 2024 22:06
@ShadowCurse ShadowCurse force-pushed the move_utils branch 3 times, most recently from b57ce62 to 0b403c3 Compare August 24, 2024 14:55
@ShadowCurse ShadowCurse force-pushed the move_utils branch 3 times, most recently from e647685 to b5951d3 Compare September 5, 2024 13:52
@ShadowCurse ShadowCurse force-pushed the move_utils branch 2 times, most recently from ce6c4f6 to fc28555 Compare September 16, 2024 14:44
@ShadowCurse ShadowCurse marked this pull request as ready for review September 16, 2024 14:44
@ShadowCurse ShadowCurse self-assigned this Sep 16, 2024
@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests labels Sep 16, 2024
`utilities` has only test related code/binaries,
so rename the module with more descriptive name.

Signed-off-by: Egor Lazarchuk <[email protected]>
Move content of `test_utils/test_utils/mod.rs` into
`test_utils/mod.rs`. This remove the duplication of
module names and makes clippy happy.

Signed-off-by: Egor Lazarchuk <[email protected]>
Most modules in `utils` are `vmm` specific,
so copy them into `vmm/utils`. The actual
removal of those files from `utils` will
happen in later commit.

Signed-off-by: Egor Lazarchuk <[email protected]>
In previous commit we moved `vmm` specific parts of `utils`
into `vmm` crate, so now we can remove them from `utils`.

Signed-off-by: Egor Lazarchuk <[email protected]>
It is better not to reexport `vmm-sys-util` as it
entangles the code. Additionally, the original
reason of having one place to update this dependency
does not hold any more as now we rely on dependabot
for updates, so specifying dependency in multiple crates
is not an issue.

Signed-off-by: Egor Lazarchuk <[email protected]>
@roypat roypat requested a review from kalyazin September 16, 2024 15:11
@ShadowCurse ShadowCurse merged commit eb26211 into firecracker-microvm:main Sep 16, 2024
4 of 7 checks passed
@ShadowCurse ShadowCurse deleted the move_utils branch September 16, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants