Crate dbs_snapshot
source ·Expand description
Provides version tolerant serialization and deserialization facilities and implements a persistent storage format for Firecracker state snapshots.
The Snapshot
API manages serialization and deserialization of collections of objects
that implement the Versionize
trait.
|––––––––––––––| | 64 bit magic_id | |––––––––––––––| | SnapshotHdr | |––––––––––––––| | State | |––––––––––––––| | optional CRC64 | |––––––––––––––|
Each structure, union or enum is versioned separately and only needs to increment their version if a field is added or removed. For each state snapshot we define 2 versions:
- the format version which refers to the SnapshotHdr, CRC, or the representation of primitives types (currently we use versionize that uses serde bincode as a backend). The current implementation does not have any logic dependent on it.
- the data version which refers to the state.
Structs
- The
Snapshot
API manages serialization and deserialization of collections of objects that implement theVersionize
trait.
Enums
- Error definitions for the Snapshot API.
Traits
- An abstract interface for saving/restoring a component using a specific state.