-
Notifications
You must be signed in to change notification settings - Fork 2k
Misc fixes #5245
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
Draft
ShadowCurse
wants to merge
8
commits into
firecracker-microvm:main
Choose a base branch
from
ShadowCurse:misc_fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Misc fixes #5245
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5245 +/- ##
==========================================
+ Coverage 82.84% 82.89% +0.04%
==========================================
Files 250 250
Lines 26967 26943 -24
==========================================
- Hits 22342 22335 -7
+ Misses 4625 4608 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
It is reasonable to assume that we will not have more than u32::MAX memory slots since kernel only returns i32 from a query syscall. Enforce this with `.expect` calls and change the type of `max_memslots` to u32. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Replaces never used error result type wit optional. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1f984e4
to
d309637
Compare
usize cannot be negative. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Add command to run any cargo command from inside container without needing to enter it. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
609db83
to
70239eb
Compare
Vcpu TLS must only be initialized once. Enforce this with an assertion. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Move setting of signal handler into vcpu init to prevent race condition between setting TLS and signal handler using TLS. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
- The reset must be called only once on vcpu drop, so move it directly into the Drop impl. - Replace errors with asserts since there is an assumption that TLS will always hold correct vcpu pointer for a given thread. - Mark Drop impl as non test only as our unit tests create multiple vcpus which will panic on Drop since they all will be referencing same TLS. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Merge run_on_thread_local into signal handler since it is only used there. The error returned from run_on_thread_local was ignored, so instead replace it with logic to only use vcpu ptr if TLS is initialized, without returning any errors. The reason for not asserting on TLS being initialized here is that during Firecracker shutdown, vcpus will be destroyed and TLS will be reset. If signal will be send to Firecracker during that time, the TLS accessed from a signal handler will be empty. But this is expected, so no assertions/panics are needed. Because Rust is a good language, it does not allow to reference TLS_VCPU_PTR definded inside impl block inside the signal_handler function. So move the TLS_VCPU_PTR definition outside the Vcpu impl block. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Minor refactors and assert additions.
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
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.