Skip to content
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

Conversation

bchalios
Copy link
Contributor

@bchalios bchalios commented Dec 1, 2023

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

  • 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.

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>
@bchalios bchalios changed the base branch from main to firecracker-v1.5 December 1, 2023 18:15
@bchalios bchalios added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Dec 1, 2023
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d785d60) 83.00% compared to head (be8ab82) 83.02%.

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     
Flag Coverage Δ
4.14-c7g.metal 78.53% <69.49%> (-0.02%) ⬇️
4.14-m5d.metal 80.33% <69.49%> (-0.03%) ⬇️
4.14-m6a.metal 79.46% <69.49%> (-0.02%) ⬇️
4.14-m6g.metal 78.53% <69.49%> (-0.02%) ⬇️
4.14-m6i.metal 80.31% <69.49%> (-0.02%) ⬇️
5.10-c7g.metal 81.47% <93.22%> (+<0.01%) ⬆️
5.10-m5d.metal 83.01% <93.22%> (-0.02%) ⬇️
5.10-m6a.metal 82.25% <93.22%> (+<0.01%) ⬆️
5.10-m6g.metal 81.47% <93.22%> (+<0.01%) ⬆️
5.10-m6i.metal 83.00% <93.22%> (+<0.01%) ⬆️
6.1-c7g.metal 81.47% <93.22%> (+<0.01%) ⬆️
6.1-m5d.metal 83.02% <93.22%> (-0.01%) ⬇️
6.1-m6a.metal 82.25% <93.22%> (+<0.01%) ⬆️
6.1-m6g.metal 81.47% <93.22%> (+<0.01%) ⬆️
6.1-m6i.metal 83.00% <93.22%> (+<0.01%) ⬆️

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.

roypat
roypat previously approved these changes Dec 1, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
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>
@bchalios bchalios merged commit 3edba6d into firecracker-microvm:firecracker-v1.5 Dec 1, 2023
5 of 7 checks passed
@bchalios bchalios deleted the backport_async_fix branch December 1, 2023 20:37
@pb8o pb8o mentioned this pull request Dec 4, 2023
9 tasks
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants