diff --git a/arch/src/aarch64/gic/gicv3.rs b/arch/src/aarch64/gic/gicv3.rs index 83d261be6..3b8d15dc5 100644 --- a/arch/src/aarch64/gic/gicv3.rs +++ b/arch/src/aarch64/gic/gicv3.rs @@ -16,16 +16,14 @@ pub mod kvm { use anyhow::anyhow; use hypervisor::kvm::kvm_bindings; use hypervisor::CpuState; + use serde::{Deserialize, Serialize}; use std::any::Any; use std::convert::TryInto; use std::sync::Arc; use std::{boxed::Box, result}; - use versionize::{VersionMap, Versionize, VersionizeResult}; - use versionize_derive::Versionize; use vm_memory::Address; use vm_migration::{ Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable, - VersionMapped, }; /// Errors thrown while saving/restoring the GICv3. @@ -67,7 +65,7 @@ pub mod kvm { vcpu_count: u64, } - #[derive(Versionize)] + #[derive(Clone, Default, Serialize, Deserialize)] pub struct Gicv3State { dist: Vec, rdist: Vec, @@ -76,8 +74,6 @@ pub mod kvm { gicd_ctlr: u32, } - impl VersionMapped for Gicv3State {} - impl KvmGicV3 { // Device trees specific constants pub const ARCH_GIC_V3_MAINT_IRQ: u32 = 9; @@ -235,12 +231,12 @@ pub mod kvm { fn snapshot(&mut self) -> std::result::Result { let gicr_typers = self.gicr_typers.clone(); - Snapshot::new_from_versioned_state(&self.id(), &self.state(&gicr_typers).unwrap()) + Snapshot::new_from_state(&self.id(), &self.state(&gicr_typers).unwrap()) } fn restore(&mut self, snapshot: Snapshot) -> std::result::Result<(), MigratableError> { let gicr_typers = self.gicr_typers.clone(); - self.set_state(&gicr_typers, &snapshot.to_versioned_state(&self.id())?) + self.set_state(&gicr_typers, &snapshot.to_state(&self.id())?) .map_err(|e| { MigratableError::Restore(anyhow!("Could not restore GICv3 state {:?}", e)) }) diff --git a/arch/src/aarch64/gic/gicv3_its.rs b/arch/src/aarch64/gic/gicv3_its.rs index 3fb036c8b..2d2e2727f 100644 --- a/arch/src/aarch64/gic/gicv3_its.rs +++ b/arch/src/aarch64/gic/gicv3_its.rs @@ -17,15 +17,13 @@ pub mod kvm { use anyhow::anyhow; use hypervisor::kvm::kvm_bindings; use hypervisor::CpuState; + use serde::{Deserialize, Serialize}; use std::any::Any; use std::convert::TryInto; use std::sync::Arc; use std::{boxed::Box, result}; - use versionize::{VersionMap, Versionize, VersionizeResult}; - use versionize_derive::Versionize; use vm_migration::{ Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable, - VersionMapped, }; const GITS_CTLR: u32 = 0x0000; @@ -161,7 +159,7 @@ pub mod kvm { vcpu_count: u64, } - #[derive(Versionize)] + #[derive(Clone, Default, Serialize, Deserialize)] pub struct Gicv3ItsState { dist: Vec, rdist: Vec, @@ -176,8 +174,6 @@ pub mod kvm { its_baser: [u64; 8], } - impl VersionMapped for Gicv3ItsState {} - impl KvmGicV3Its { fn get_msi_size() -> u64 { layout::GIC_V3_ITS_SIZE @@ -480,12 +476,12 @@ pub mod kvm { fn snapshot(&mut self) -> std::result::Result { let gicr_typers = self.gicr_typers.clone(); - Snapshot::new_from_versioned_state(&self.id(), &self.state(&gicr_typers).unwrap()) + Snapshot::new_from_state(&self.id(), &self.state(&gicr_typers).unwrap()) } fn restore(&mut self, snapshot: Snapshot) -> std::result::Result<(), MigratableError> { let gicr_typers = self.gicr_typers.clone(); - self.set_state(&gicr_typers, &snapshot.to_versioned_state(&self.id())?) + self.set_state(&gicr_typers, &snapshot.to_state(&self.id())?) .map_err(|e| { MigratableError::Restore(anyhow!("Could not restore GICv3ITS state {:?}", e)) })