-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Backport fix for PATCH async block devices to Firecracker 1.5 #4295
Merged
bchalios
merged 4 commits into
firecracker-microvm:firecracker-v1.5
from
bchalios:backport_async_fix
Dec 1, 2023
Merged
Backport fix for PATCH async block devices to Firecracker 1.5 #4295
bchalios
merged 4 commits into
firecracker-microvm:firecracker-v1.5
from
bchalios:backport_async_fix
Dec 1, 2023
Conversation
This file contains 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
So far, tests for virtio block devices only used the synchronous engine for testing. This commit, uses the "io_engine" fixture which returns both "Sync" and "Async" (for the kernels > 4.14). It also adds a test the we can mount devices after patching the backing file on the host. Signed-off-by: Babis Chalios <bchalios@amazon.es>
In test test_send_ctrl_alt_del we send a CTRL+ALT+DEL to the microVM, which, in x86, makes the microVM to shutdown. Then we send a signal to the Firecracker process with `os.kill(firecracker_pid, 0)` and wait for it to fail. This works but logs an error in the test logs which can be confusing. Instead we can call os.waitpid() which waits for the Firecracker process to exit and returns immediately if the process has already exited. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## firecracker-v1.5 #4295 +/- ##
====================================================
+ Coverage 83.00% 83.02% +0.01%
====================================================
Files 223 223
Lines 28459 28494 +35
====================================================
+ Hits 23622 23656 +34
- Misses 4837 4838 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
roypat
previously approved these changes
Dec 1, 2023
kalyazin
reviewed
Dec 1, 2023
c1ffc03
to
9566e3c
Compare
The asynchronous engine maintains an event file descriptor which passes to the IO uring interface when creating a new ring. IO uring uses this EventFd to notify us about completion of IO requests. When we PATCH an async block device, we create a new asynchronous engine, including a new EventFd. However, we still monitor the old EventFd. This breaks the use of async drives post PATCH requests, because we never get notified about the results of requests we submit to the IO uring engine. This commit changes the implementation along the PATCH code path, to reuse the previous EventFd for the asynchronous engine. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Add the fix for the async engine in the "Fixed" section of the CHANGELOG. Signed-off-by: Babis Chalios <bchalios@amazon.es>
9566e3c
to
be8ab82
Compare
kalyazin
approved these changes
Dec 1, 2023
wearyzen
approved these changes
Dec 1, 2023
3edba6d
into
firecracker-microvm:firecracker-v1.5
5 of 7 checks passed
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
Backport #4286 to
firecracker-v1.5
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
CHANGELOG.md
.TODO
s link to an issue.rust-vmm
.