#micro-vm #firecracker #snapshot #virtualization #aarch64 #hvf

squib-snapshot

Squib snapshot subsystem: bitcode state file, sparse memory file, dirty-page tracking

1 unstable release

Uses new Rust 2024

0.2.0 May 28, 2026

#20 in #firecracker

Download history 98/week @ 2026-05-26

98 downloads per month
Used in 7 crates (3 directly)

Apache-2.0

135KB
2.5K SLoC

squib-snapshot — bitcode state file, sparse memory file, dirty-page tracking.

Implements Phase 5 of the squib roadmap. The crate is split into:

  • error — wire-stable SnapshotError (I-RC-8 in 11 § 7).
  • stateMicrovmState and child structs (vCPU, GIC, MMDS, devices).
  • envelopeSnapshot<T> outer container with bitcode + CRC64 trailer.
  • atomic — D25 temp-file + fsync + rename writer with cross-FS pre-flight check.
  • memory — Full / sparse-of-dirty memory-file writer.
  • dirtyBox<[AtomicU64]> dirty bitmap + adaptive heuristic (D11 + D21).
  • [mod@save] / [mod@load] — high-level orchestrators that tie the pieces together.

Cross-references: 16-snapshots.md, 10-data-model.md § 5–6, 11-runtime-core. md § 6, 99-key-decisions.md § D5, D11, D21, D25.

Quality bar

#![forbid(unsafe_code)] — every public surface is safe Rust. The Mach-exception pager that backs --mem-backend=Uffd lives in the sibling squib-host crate where the unsafe is bounded and reviewed.

Dependencies

~6–11MB
~135K SLoC