feat: auto-quiesce clone/export on running boxes + REST import_box#283
Merged
DorianZheng merged 4 commits intomainfrom Feb 20, 2026
Merged
feat: auto-quiesce clone/export on running boxes + REST import_box#283DorianZheng merged 4 commits intomainfrom
DorianZheng merged 4 commits intomainfrom
Conversation
Replace require_stopped_for with SIGSTOP/SIGCONT-based PauseGuard for clone and export operations, allowing them to work on running boxes without requiring a manual stop. Disable snapshot APIs (to be re-enabled later). Implement REST client import_box to enable cross-backend archive portability. Key changes: - PauseGuard: RAII guard that freezes VM via SIGSTOP, resumes on drop - clone_box/export work on running boxes (auto-quiesce via PauseGuard) - Snapshot APIs return unimplemented error (temporarily disabled) - REST import_box client: reads archive, POSTs to /boxes/import - Fix clone_cow Disk RAII leak (.leak() prevents auto-delete) - Python examples for clone/export/import and local-to-REST migration
…ion metrics - Fix FIFREEZE/FITHAW ioctl numbers: replace nix::ioctl_write_int! (_IOW) with raw libc::ioctl using correct _IOWR constants (0xC0045877/0xC0045878) - Split export into two phases: only disk flatten runs inside quiesce bracket (VM paused ~550ms), checksum+archive run after VM resumes (~6.5s saved) - Add Instant-based timing metrics to all operations (start, stop, clone, export, import, snapshot, quiesce phases) - Remove debug artifacts (eprintln, sleep) from with_quiesce_async - Add CLAUDE.md rule #15: no sleep for events
… backend - Merge latest main (jailer hardening, Node.js SDK, CI fixes) - Fix jailer test: Qcow2Helper::new() → static method call - Wire SnapshotHandle to delegate to SnapshotBackend (was returning unimplemented stubs, causing dead code warnings for entire REST snapshot chain) - Remove stale #[allow(dead_code)] from snapshot code
2cdbd1e to
8a66622
Compare
Start the reference server as a subprocess on a random port instead of requiring manual server startup. Removes a common source of confusion and stale-build errors.
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
require_stopped_forwith SIGSTOP/SIGCONT-basedPauseGuardso clone and export work on running boxes without manual stopimport_boxto enable cross-backend archive portability (local export → REST import)clone_cowDisk RAII leak (.leak()prevents auto-delete of COW disks)Test plan
cargo clippy -p boxlite --tests -- -D warnings— cleancargo test -p boxlite --lib— 452 tests passcargo test -p boxlite --test clone_export_import -- --ignored— 6 integration tests passpython examples/python/03_lifecycle/clone_export_import.py— all 3 tests passpython examples/python/07_advanced/local_to_rest_migration.py— local→REST migration verified