vm-migration: Add versioned versions of snapshot & state API

This will allow progressive porting of parts of the VMM to using
versioned state. A new trait VersionMapped is introduced with a default
implementation that returns an empty VersionMap to ease implementation.

If a struct is updated the the trait will need to be fully implemented
with VersionMapped::version_map() returning a new VersionMap handling
the change.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2021-05-05 15:16:19 +00:00
parent 2eeeaf5753
commit bbda08717f
3 changed files with 112 additions and 0 deletions

View File

@@ -10,4 +10,6 @@ thiserror = "1.0"
serde = {version = ">=1.0.27", features = ["rc"] }
serde_derive = ">=1.0.27"
serde_json = ">=1.0.9"
versionize = "0.1.6"
versionize_derive = "0.1.4"
vm-memory = { version = "0.5.0", features = ["backend-mmap", "backend-atomic"] }