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

Snapshot editor #4045

Merged
merged 8 commits into from
Aug 25, 2023
Merged

Conversation

ShadowCurse
Copy link
Contributor

Changes

Added initial version of snapshot-editor tool.
Initial functionality is:

  • (aarch64 only) remove registers from vcpu states
  • (aarch64 only) print all vcpu states from vmstate file

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.

@ShadowCurse ShadowCurse added the Type: Enhancement Indicates new feature requests label Aug 17, 2023
@ShadowCurse ShadowCurse self-assigned this Aug 17, 2023
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage: 22.58% and project coverage change: -0.33% ⚠️

Comparison is base (1639a95) 82.70% compared to head (3319a27) 82.37%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4045      +/-   ##
==========================================
- Coverage   82.70%   82.37%   -0.33%     
==========================================
  Files         220      224       +4     
  Lines       28253    28398     +145     
==========================================
+ Hits        23366    23393      +27     
- Misses       4887     5005     +118     
Flag Coverage Δ
4.14-c7g.metal 77.80% <22.22%> (-0.36%) ⬇️
4.14-m5d.metal 79.68% <12.04%> (-0.22%) ⬇️
4.14-m6a.metal 78.82% <12.04%> (-0.23%) ⬇️
4.14-m6g.metal 77.80% <22.22%> (-0.36%) ⬇️
4.14-m6i.metal 79.68% <12.04%> (-0.22%) ⬇️
5.10-c7g.metal 80.72% <22.22%> (-0.38%) ⬇️
5.10-m5d.metal ?
5.10-m6a.metal 81.60% <12.04%> (-0.24%) ⬇️
5.10-m6g.metal 80.72% <22.22%> (-0.38%) ⬇️
5.10-m6i.metal 82.36% <12.04%> (-0.23%) ⬇️
6.1-c7g.metal 80.72% <22.22%> (-0.38%) ⬇️
6.1-m5d.metal 82.36% <12.04%> (-0.23%) ⬇️
6.1-m6a.metal 81.60% <12.04%> (-0.24%) ⬇️
6.1-m6g.metal 80.72% <22.22%> (-0.38%) ⬇️
6.1-m6i.metal 82.35% <12.04%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/snapshot-editor/src/info.rs 0.00% <0.00%> (ø)
src/snapshot-editor/src/utils.rs 0.00% <0.00%> (ø)
src/vmm/src/lib.rs 61.90% <ø> (ø)
src/vmm/src/vstate/vcpu/aarch64.rs 93.61% <ø> (ø)
src/vmm/src/vstate/vcpu/mod.rs 85.88% <ø> (ø)
src/vmm/src/vstate/vcpu/x86_64.rs 88.85% <ø> (ø)
src/snapshot-editor/src/main.rs 5.00% <5.00%> (ø)
src/vmm/src/persist.rs 53.61% <25.00%> (-0.15%) ⬇️
src/snapshot-editor/src/edit_vmstate.rs 49.01% <49.01%> (ø)
src/snapshot/src/lib.rs 99.18% <100.00%> (+<0.01%) ⬆️
... and 2 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ShadowCurse ShadowCurse force-pushed the snapshot_editor branch 9 times, most recently from 491698c to 8c8570b Compare August 18, 2023 13:20
@ShadowCurse ShadowCurse marked this pull request as ready for review August 18, 2023 13:25
@ShadowCurse ShadowCurse added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Aug 18, 2023
@ShadowCurse ShadowCurse requested a review from a team August 18, 2023 15:00
Copy link
Contributor

@roypat roypat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just the changelog could maybe explain a new tool a bit better

CHANGELOG.md Show resolved Hide resolved
src/snapshot-editor/src/info.rs Show resolved Hide resolved
roypat
roypat previously approved these changes Aug 21, 2023
docs/snapshotting/snapshot-editor.md Outdated Show resolved Hide resolved
docs/snapshotting/snapshot-editor.md Outdated Show resolved Hide resolved
src/snapshot-editor/src/edit_vmstate.rs Outdated Show resolved Hide resolved
docs/snapshotting/snapshot-editor.md Show resolved Hide resolved
@ShadowCurse ShadowCurse force-pushed the snapshot_editor branch 2 times, most recently from 17df589 to 5bde3be Compare August 23, 2023 16:37
@ShadowCurse ShadowCurse force-pushed the snapshot_editor branch 6 times, most recently from f6e2bd5 to 39ee5ef Compare August 24, 2023 09:59
Modified snapshot loading code to return version along side
the deserialized object.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
These changes (and one in the next commit) are needed
to be able to use `MicrovmState::default()`.
This is needed to test `snapshot-editor`.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
These changes are needed for `snapshot-editor` (added in next commits)
to access internal `vmm` structs.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
After making several modules public in previous commit, we need to
add comments to all public members because of `missing_doc` lint
that we have.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse ShadowCurse force-pushed the snapshot_editor branch 4 times, most recently from c1da82c to c6c8b71 Compare August 24, 2023 12:14
roypat
roypat previously approved these changes Aug 24, 2023
Added snapshot-editor tool with minimal initial
functionality.
So far it can:
- print snapshot version
- (aarch64 only) remove registers from vcpu states
- (aarch64 only) print registers inside vcpu states

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added initial documentation for `snapshot-editor` tool.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added integration test for `snapshot-editor`
to test `remove-regs` functionality.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added `snapshot-editor` to the CHANGELOG

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse ShadowCurse merged commit 49294ff into firecracker-microvm:main Aug 25, 2023
3 of 5 checks passed
@ShadowCurse ShadowCurse deleted the snapshot_editor branch August 25, 2023 09:58
@JonathanWoollett-Light JonathanWoollett-Light added this to the 1.5 milestone Dec 7, 2023
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: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants