hypervisor: provide a generic ClockData structure

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-14 14:16:49 +00:00
committed by Liu Wei
parent beb4f86b82
commit 4201bf4011
5 changed files with 68 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ use vm::DataMatch;
pub mod x86_64;
use crate::device;
use crate::{
CpuState, IoEventAddress, MpState, UserMemoryRegion, USER_MEMORY_REGION_EXECUTE,
ClockData, CpuState, IoEventAddress, MpState, UserMemoryRegion, USER_MEMORY_REGION_EXECUTE,
USER_MEMORY_REGION_READ, USER_MEMORY_REGION_WRITE,
};
use vmm_sys_util::eventfd::EventFd;
@@ -1148,4 +1148,14 @@ impl vm::Vm for MshvVm {
)
.map_err(|e| vm::HypervisorVmError::GetDirtyLog(e.into()))
}
/// Retrieve guest clock.
#[cfg(target_arch = "x86_64")]
fn get_clock(&self) -> vm::Result<ClockData> {
Ok(ClockData::Mshv)
}
/// Set guest clock.
#[cfg(target_arch = "x86_64")]
fn set_clock(&self, _data: &ClockData) -> vm::Result<()> {
Ok(())
}
}