vm-migration: Simplify SnapshotData implementation

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2022-12-02 14:59:44 +01:00
parent 1d1043316b
commit 426ee39972

View File

@ -109,9 +109,7 @@ impl SnapshotData {
let data = serde_json::to_vec(state)
.map_err(|e| MigratableError::Snapshot(anyhow!("Error serialising: {}", e)))?;
let snapshot_data = SnapshotData(data);
Ok(snapshot_data)
Ok(SnapshotData(data))
}
/// Create from versioned state
@ -124,9 +122,7 @@ impl SnapshotData {
.serialize(&mut data, &T::version_map(), VMM_VERSION)
.map_err(|e| MigratableError::Snapshot(anyhow!("Error serialising: {}", e)))?;
let snapshot_data = SnapshotData(data);
Ok(snapshot_data)
Ok(SnapshotData(data))
}
}