mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Migrate away from versionize
Replace with serde instead. Fixes: #6370 Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
@@ -25,6 +25,7 @@ use crate::{GuestMemoryMmap, GuestRegionMmap};
|
||||
use crate::{VirtioInterrupt, VirtioInterruptType};
|
||||
use anyhow::anyhow;
|
||||
use seccompiler::SeccompAction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
use std::io;
|
||||
use std::mem::size_of;
|
||||
@@ -34,8 +35,6 @@ use std::sync::atomic::AtomicBool;
|
||||
use std::sync::mpsc;
|
||||
use std::sync::{Arc, Barrier, Mutex};
|
||||
use thiserror::Error;
|
||||
use versionize::{VersionMap, Versionize, VersionizeResult};
|
||||
use versionize_derive::Versionize;
|
||||
use virtio_queue::{DescriptorChain, Queue, QueueT};
|
||||
use vm_device::dma_mapping::ExternalDmaMapping;
|
||||
use vm_memory::{
|
||||
@@ -43,9 +42,7 @@ use vm_memory::{
|
||||
GuestMemoryError, GuestMemoryLoadGuard, GuestMemoryRegion,
|
||||
};
|
||||
use vm_migration::protocol::MemoryRangeTable;
|
||||
use vm_migration::{
|
||||
Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable, VersionMapped,
|
||||
};
|
||||
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
const QUEUE_SIZE: u16 = 128;
|
||||
@@ -170,7 +167,7 @@ struct VirtioMemResp {
|
||||
unsafe impl ByteValued for VirtioMemResp {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Versionize)]
|
||||
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct VirtioMemConfig {
|
||||
// Block size and alignment. Cannot change.
|
||||
block_size: u64,
|
||||
@@ -338,7 +335,7 @@ impl Request {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Versionize)]
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct BlocksState {
|
||||
bitmap: Vec<bool>,
|
||||
}
|
||||
@@ -688,7 +685,7 @@ pub enum VirtioMemMappingSource {
|
||||
Device(u32),
|
||||
}
|
||||
|
||||
#[derive(Versionize)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct MemState {
|
||||
pub avail_features: u64,
|
||||
pub acked_features: u64,
|
||||
@@ -696,8 +693,6 @@ pub struct MemState {
|
||||
pub blocks_state: BlocksState,
|
||||
}
|
||||
|
||||
impl VersionMapped for MemState {}
|
||||
|
||||
pub struct Mem {
|
||||
common: VirtioCommon,
|
||||
id: String,
|
||||
@@ -1013,7 +1008,7 @@ impl Snapshottable for Mem {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
Snapshot::new_from_versioned_state(&self.state())
|
||||
Snapshot::new_from_state(&self.state())
|
||||
}
|
||||
}
|
||||
impl Transportable for Mem {}
|
||||
|
||||
Reference in New Issue
Block a user