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

View File

@@ -40,22 +40,19 @@ use crate::{
use anyhow::anyhow;
use byteorder::{ByteOrder, LittleEndian};
use seccompiler::SeccompAction;
use serde::{Deserialize, Serialize};
use std::io;
use std::os::unix::io::AsRawFd;
use std::path::PathBuf;
use std::result;
use std::sync::atomic::AtomicBool;
use std::sync::{Arc, Barrier, RwLock};
use versionize::{VersionMap, Versionize, VersionizeResult};
use versionize_derive::Versionize;
use virtio_queue::Queue;
use virtio_queue::QueueOwnedT;
use virtio_queue::QueueT;
use vm_memory::GuestAddressSpace;
use vm_memory::GuestMemoryAtomic;
use vm_migration::{
Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable, VersionMapped,
};
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};
use vm_virtio::AccessPlatform;
use vmm_sys_util::eventfd::EventFd;
@@ -323,14 +320,12 @@ pub struct Vsock<B: VsockBackend> {
exit_evt: EventFd,
}
#[derive(Versionize)]
#[derive(Serialize, Deserialize)]
pub struct VsockState {
pub avail_features: u64,
pub acked_features: u64,
}
impl VersionMapped for VsockState {}
impl<B> Vsock<B>
where
B: VsockBackend + Sync,
@@ -519,7 +514,7 @@ where
}
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
Snapshot::new_from_versioned_state(&self.state())
Snapshot::new_from_state(&self.state())
}
}
impl<B> Transportable for Vsock<B> where B: VsockBackend + Sync + 'static {}