Skip to content

Port-forward fixes merged into 1.7 release branch #4482

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

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

roypat
Copy link
Contributor

@roypat roypat commented Mar 1, 2024

Cherry-picks changes from #4476 and #4480 into main

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.

roypat added 3 commits March 1, 2024 14:58
The function pointer is called for every device being restored, however
all use-sites of it pointed to the same function
(VmResources::update_from_restored_device), so the
indirection/abstraction is not needed. Removing this function point
removes restrictions on the signature of the function, and thus makes
adding error handling easier (for example, we can now update
update_from_restored_device to validate whether the devices read from
the snapshot are actually consistent with the rest of the vm
configuration).

The entire `SharedDeviceType` enum can probably be removed too, but lets
keep the changes minimal in this commit, as its for the 1.7 release
branch.

Signed-off-by: Patrick Roy <[email protected]>
Insert a check into the snapshot restore routine that checks that a
snapshot file cannot indicate both huge pages being enabled, while also
listing a balloon device. If this condition is detected, refuse to load
the snapshot and print an error suggesting that the snapshot file is
corrupt.

Signed-off-by: Patrick Roy <[email protected]>
When switching from Versionize to bincode in firecracker-microvm#4230, we accidentally
dropped a check limiting how much memory the deserialization routine can
allocate [[1]]. This commit reimplements this check for the new
bincode-based deserialization routine, with a limit matching that of the
old Versionize check.

[1]: https://github.com/firecracker-microvm/versionize/blob/main/src/primitives.rs#L14C33-L14C43

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Mar 1, 2024
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.63%. Comparing base (5f95011) to head (ce096ff).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4482   +/-   ##
=======================================
  Coverage   81.63%   81.63%           
=======================================
  Files         243      243           
  Lines       29791    29794    +3     
=======================================
+ Hits        24319    24322    +3     
  Misses       5472     5472           
Flag Coverage Δ
4.14-c5n.metal 78.94% <96.87%> (-0.01%) ⬇️
4.14-c7g.metal ?
4.14-m5d.metal ?
4.14-m5n.metal 78.93% <96.87%> (-0.01%) ⬇️
4.14-m6a.metal 78.07% <96.87%> (-0.01%) ⬇️
4.14-m6g.metal 77.03% <96.87%> (-0.01%) ⬇️
4.14-m6i.metal 78.93% <96.87%> (-0.01%) ⬇️
4.14-m7g.metal 77.03% <96.87%> (-0.01%) ⬇️
5.10-c5n.metal 81.60% <100.00%> (+<0.01%) ⬆️
5.10-c7g.metal ?
5.10-m5d.metal ?
5.10-m5n.metal 81.59% <100.00%> (+<0.01%) ⬆️
5.10-m6a.metal 80.83% <100.00%> (+<0.01%) ⬆️
5.10-m6g.metal 79.92% <100.00%> (+<0.01%) ⬆️
5.10-m6i.metal 81.59% <100.00%> (+<0.01%) ⬆️
5.10-m7g.metal 79.92% <100.00%> (+<0.01%) ⬆️
6.1-c5n.metal 81.60% <100.00%> (+<0.01%) ⬆️
6.1-c7g.metal ?
6.1-m5d.metal ?
6.1-m5n.metal 81.59% <100.00%> (+<0.01%) ⬆️
6.1-m6a.metal 80.83% <100.00%> (+<0.01%) ⬆️
6.1-m6g.metal 79.92% <100.00%> (+<0.01%) ⬆️
6.1-m6i.metal 81.59% <100.00%> (+<0.01%) ⬆️
6.1-m7g.metal 79.92% <100.00%> (+<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 merged commit 369bcdb into firecracker-microvm:main Mar 1, 2024
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.

3 participants