Skip to content

feat: auto-quiesce clone/export on running boxes + REST import_box#283

Merged
DorianZheng merged 4 commits intomainfrom
feat/auto-quiesce-clone-export-import
Feb 20, 2026
Merged

feat: auto-quiesce clone/export on running boxes + REST import_box#283
DorianZheng merged 4 commits intomainfrom
feat/auto-quiesce-clone-export-import

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Replace require_stopped_for with SIGSTOP/SIGCONT-based PauseGuard so clone and export work on running boxes without manual stop
  • Disable snapshot APIs temporarily (will re-enable later)
  • Implement REST client import_box to enable cross-backend archive portability (local export → REST import)
  • Fix clone_cow Disk RAII leak (.leak() prevents auto-delete of COW disks)
  • Add Python examples for clone/export/import and local-to-REST migration

Test plan

  • cargo clippy -p boxlite --tests -- -D warnings — clean
  • cargo test -p boxlite --lib — 452 tests pass
  • cargo test -p boxlite --test clone_export_import -- --ignored — 6 integration tests pass
  • python examples/python/03_lifecycle/clone_export_import.py — all 3 tests pass
  • python examples/python/07_advanced/local_to_rest_migration.py — local→REST migration verified

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
@DorianZheng DorianZheng force-pushed the feat/auto-quiesce-clone-export-import branch from 2cdbd1e to 8a66622 Compare February 20, 2026 11:33
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.
@DorianZheng DorianZheng merged commit c3f7c0f into main Feb 20, 2026
26 checks passed
@DorianZheng DorianZheng deleted the feat/auto-quiesce-clone-export-import branch February 20, 2026 12:24
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