Centralize snapshot utilities into snapshot_store module#24
Merged
Conversation
- Moved snapshot-related logic (e.g., hashing, directory management, listing, deletion) into a new `snapshot_store` module for better modularity and cross-platform compatibility. - Updated imports and restructured functions like `compute_config_hash` and `snapshot_dir_for_hash` to use the new module. - Simplified platform-specific code paths in `cmd_snapshot` by isolating shared functionality in `snapshot_store`. - Ensured comprehensive tests for `snapshot_store`, including VZ and KVM integration scenarios.
Resolve conflict in src/vmm/snapshot.rs: keep snapshot_store re-exports (config hash, listing, deletion moved to snapshot_store module). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Implemented conditional handling for `x86_64` and `aarch64` architectures in snapshot serialization/deserialization tests (`test_vcpu_state_serde_roundtrip`, `test_vm_snapshot_serde_roundtrip`). - Updated `capture_irqchip` and `restore_irqchip` functions to reduce unused variable warnings by changing parameter names to `_vm` and `_state`.
- Removed unnecessary `GuestMemoryMmap` import from `boot.rs`. - Updated `kvm_bindings` device type constants to use aliased names for consistency. - Enhanced vCPU configuration by initializing `kvm_vcpu_init` directly with `get_preferred_target`. - Added conditional `SYS_poll` and `SYS_epoll_wait` handling for better architecture support.
- Fix kvm-bindings constant names (kvm_device_type_ prefix) - Fix get_preferred_target API (takes &mut kvm_vcpu_init) - Gate x86_64-only syscalls (SYS_epoll_wait, SYS_poll) with cfg - Remove unused import (GuestMemoryMmap) and variables - Make snapshot tests arch-conditional for VcpuState fields - Add runner.arch to CI cache keys to prevent cross-arch pollution - Add aarch64 cross-check instructions to AGENTS.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
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.
snapshot_storemodule for better modularity and cross-platform compatibility.compute_config_hashandsnapshot_dir_for_hashto use the new module.cmd_snapshotby isolating shared functionality insnapshot_store.snapshot_store, including VZ and KVM integration scenarios.