refactor: extract clone/export/import into dedicated modules#284
Merged
DorianZheng merged 2 commits intomainfrom Feb 21, 2026
Merged
refactor: extract clone/export/import into dedicated modules#284DorianZheng merged 2 commits intomainfrom
DorianZheng merged 2 commits intomainfrom
Conversation
- Extract clone_export.rs from box_impl.rs (~310 lines) - Extract import.rs from rt_impl.rs with named helper functions - Add provision_box() to deduplicate box identity/config/persist pattern - Move clone_cow() to Qcow2Helper::clone_disk_pair() in disk layer - Delete dead build_tar_archive() from archive.rs
Pre-existing changes needed by the clone/export/import refactoring.
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.
Summary
box_impl.rs(~310 lines) intolitebox/clone_export.rsrt_impl.rsintoruntime/import.rswith named helper functions (extract_and_validate,install_disks)provision_box()helper toRuntimeImplto deduplicate box identity + config + persist pattern used by clone, import, and createclone_cow()toQcow2Helper::clone_disk_pair()where it belongs (disk layer)build_tar_archive()fromarchive.rsTest plan
cargo test -p boxlite)cargo clippy -p boxlite --tests -- -D warnings)cargo fmt --check)