Skip to content

refactor: extract clone/export/import into dedicated modules#284

Merged
DorianZheng merged 2 commits intomainfrom
refactor/clone-export-import
Feb 21, 2026
Merged

refactor: extract clone/export/import into dedicated modules#284
DorianZheng merged 2 commits intomainfrom
refactor/clone-export-import

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Extract clone/export operations from box_impl.rs (~310 lines) into litebox/clone_export.rs
  • Extract import logic from rt_impl.rs into runtime/import.rs with named helper functions (extract_and_validate, install_disks)
  • Add provision_box() helper to RuntimeImpl to deduplicate box identity + config + persist pattern used by clone, import, and create
  • Move clone_cow() to Qcow2Helper::clone_disk_pair() where it belongs (disk layer)
  • Delete dead build_tar_archive() from archive.rs

Test plan

  • All 480 unit tests pass (cargo test -p boxlite)
  • Clippy clean (cargo clippy -p boxlite --tests -- -D warnings)
  • Format clean (cargo fmt --check)
  • Integration tests (pre-existing SUN_LEN failures on macOS, unrelated)

- 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.
@DorianZheng DorianZheng merged commit 484193c into main Feb 21, 2026
14 checks passed
@DorianZheng DorianZheng deleted the refactor/clone-export-import branch February 21, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant