Skip to content

fix: snapshot: disallow snapshots with vhost-user devices#5845

Merged
ShadowCurse merged 1 commit into
firecracker-microvm:mainfrom
ShadowCurse:pre_snapshot_checks
Apr 23, 2026
Merged

fix: snapshot: disallow snapshots with vhost-user devices#5845
ShadowCurse merged 1 commit into
firecracker-microvm:mainfrom
ShadowCurse:pre_snapshot_checks

Conversation

@ShadowCurse

Copy link
Copy Markdown
Contributor

Changes

Previously we were incorrectly allow snapshots to be created even with vhost-user devices by simply ignoring them. Now we correctly return an error if we detect vhost-user devices.

Reason

Follow the docs: https://github.com/firecracker-microvm/firecracker/blob/main/docs/api_requests/block-vhost-user.md#snapshot-support

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

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.42105% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.06%. Comparing base (d9c543d) to head (02e15a2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/vmm/src/lib.rs 58.62% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5845      +/-   ##
==========================================
+ Coverage   83.04%   83.06%   +0.01%     
==========================================
  Files         276      276              
  Lines       29558    29583      +25     
==========================================
+ Hits        24547    24573      +26     
+ Misses       5011     5010       -1     
Flag Coverage Δ
5.10-m5n.metal 83.39% <65.71%> (+0.01%) ⬆️
5.10-m6a.metal 82.71% <65.71%> (+0.01%) ⬆️
5.10-m6g.metal 79.98% <65.71%> (+0.02%) ⬆️
5.10-m6i.metal 83.38% <65.71%> (+0.01%) ⬆️
5.10-m7a.metal-48xl 82.71% <65.71%> (+0.02%) ⬆️
5.10-m7g.metal 79.98% <65.71%> (+0.02%) ⬆️
5.10-m7i.metal-24xl 83.35% <65.71%> (+0.01%) ⬆️
5.10-m7i.metal-48xl 83.36% <65.71%> (+0.02%) ⬆️
5.10-m8g.metal-24xl 79.98% <65.71%> (+0.02%) ⬆️
5.10-m8g.metal-48xl 79.98% <65.71%> (+0.02%) ⬆️
5.10-m8i.metal-48xl 83.36% <65.71%> (+0.02%) ⬆️
5.10-m8i.metal-96xl 83.36% <65.71%> (+0.02%) ⬆️
6.1-m5n.metal 83.41% <65.71%> (+0.02%) ⬆️
6.1-m6a.metal 82.74% <65.71%> (+0.01%) ⬆️
6.1-m6g.metal 79.98% <65.71%> (+0.02%) ⬆️
6.1-m6i.metal 83.41% <65.71%> (+0.01%) ⬆️
6.1-m7a.metal-48xl 82.73% <65.71%> (+0.01%) ⬆️
6.1-m7g.metal 79.98% <65.71%> (+0.01%) ⬆️
6.1-m7i.metal-24xl 83.42% <65.71%> (+0.02%) ⬆️
6.1-m7i.metal-48xl 83.43% <65.71%> (+0.02%) ⬆️
6.1-m8g.metal-24xl 79.97% <65.71%> (+0.01%) ⬆️
6.1-m8g.metal-48xl 79.98% <65.71%> (+0.02%) ⬆️
6.1-m8i.metal-48xl 83.43% <65.71%> (+0.02%) ⬆️
6.1-m8i.metal-96xl 83.43% <65.71%> (+0.02%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ShadowCurse ShadowCurse force-pushed the pre_snapshot_checks branch 3 times, most recently from cc3f773 to 236328a Compare April 21, 2026 13:03
@ShadowCurse ShadowCurse self-assigned this Apr 21, 2026
@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Fix Indicates a fix to existing code labels Apr 21, 2026
zulinx86
zulinx86 previously approved these changes Apr 21, 2026
Comment thread src/vmm/src/lib.rs Outdated
Comment thread src/vmm/src/lib.rs Outdated
Comment thread src/vmm/src/lib.rs Outdated
Comment thread src/vmm/src/device_manager/persist.rs
@ShadowCurse ShadowCurse force-pushed the pre_snapshot_checks branch 4 times, most recently from e09f70e to 413525d Compare April 22, 2026 10:44
Previously we were incorrectly allow snapshots to be created
even with vhost-user devices by simply ignoring them. Now we
correctly return an error if we detect vhost-user devices.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse ShadowCurse force-pushed the pre_snapshot_checks branch from 413525d to 02e15a2 Compare April 22, 2026 11:05
@ShadowCurse ShadowCurse merged commit a6b64fc into firecracker-microvm:main Apr 23, 2026
6 of 7 checks passed
@ShadowCurse ShadowCurse deleted the pre_snapshot_checks branch April 23, 2026 10: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: Fix Indicates a fix to existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants