misc: Migrate away from versionize

Replace with serde instead.

Fixes: #6370

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford
2024-04-07 14:28:07 +01:00
committed by Bo Chen
parent dad55fcef2
commit 10ab87d6a3
45 changed files with 219 additions and 471 deletions
+4 -5
View File
@@ -94,7 +94,7 @@ use vm_memory::{
use vm_migration::protocol::{Request, Response, Status};
use vm_migration::{
protocol::MemoryRangeTable, snapshot_from_id, Migratable, MigratableError, Pausable, Snapshot,
SnapshotData, Snapshottable, Transportable,
Snapshottable, Transportable,
};
use vmm_sys_util::eventfd::EventFd;
use vmm_sys_util::sock_ctrl_msg::ScmSocket;
@@ -2579,15 +2579,14 @@ impl Snapshottable for Vm {
})?
};
let vm_snapshot_data = serde_json::to_vec(&VmSnapshot {
let vm_snapshot_state = VmSnapshot {
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
clock: self.saved_clock,
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
common_cpuid,
})
.map_err(|e| MigratableError::Snapshot(e.into()))?;
};
let mut vm_snapshot = Snapshot::from_data(SnapshotData(vm_snapshot_data));
let mut vm_snapshot = Snapshot::new_from_state(&vm_snapshot_state)?;
let (id, snapshot) = {
let mut cpu_manager = self.cpu_manager.lock().unwrap();