hypervisor, vmm: drop VmState and code

VmState was introduced to hold hypervisor specific VM state. KVM does
not need it and MSHV does not really use it yet.

Just drop the code. It can be easily revived once there is a need.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-14 13:52:52 +00:00
committed by Liu Wei
parent 72d552e5e1
commit beb4f86b82
5 changed files with 4 additions and 75 deletions

View File

@@ -25,7 +25,6 @@ use crate::vm::{self, InterruptSourceConfig, VmOps};
#[cfg(target_arch = "aarch64")]
use crate::{arm64_core_reg_id, offset__of};
use kvm_ioctls::{NoDatamatch, VcpuFd, VmFd};
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::collections::HashMap;
#[cfg(target_arch = "aarch64")]
@@ -263,11 +262,6 @@ impl From<CpuState> for VcpuKvmState {
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct KvmVmState {}
pub use KvmVmState as VmState;
struct KvmDirtyLogSlot {
slot: u32,
guest_phys_addr: u64,
@@ -280,7 +274,6 @@ pub struct KvmVm {
fd: Arc<VmFd>,
#[cfg(target_arch = "x86_64")]
msrs: MsrEntries,
state: KvmVmState,
dirty_log_slots: Arc<RwLock<HashMap<u32, KvmDirtyLogSlot>>>,
}
@@ -657,19 +650,6 @@ impl vm::Vm for KvmVm {
self.create_device(&mut vfio_dev)
.map_err(|e| vm::HypervisorVmError::CreatePassthroughDevice(e.into()))
}
///
/// Get the Vm state. Return VM specific data
///
fn state(&self) -> vm::Result<VmState> {
Ok(self.state)
}
///
/// Set the VM state
///
fn set_state(&self, _state: VmState) -> vm::Result<()> {
Ok(())
}
///
/// Start logging dirty pages
///
@@ -914,7 +894,6 @@ impl hypervisor::Hypervisor for KvmHypervisor {
Ok(Arc::new(KvmVm {
fd: vm_fd,
msrs,
state: VmState {},
dirty_log_slots: Arc::new(RwLock::new(HashMap::new())),
}))
}
@@ -923,7 +902,6 @@ impl hypervisor::Hypervisor for KvmHypervisor {
{
Ok(Arc::new(KvmVm {
fd: vm_fd,
state: VmState {},
dirty_log_slots: Arc::new(RwLock::new(HashMap::new())),
}))
}