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

@@ -16,7 +16,7 @@ use crate::cpu::Vcpu;
use crate::device::Device;
#[cfg(feature = "tdx")]
use crate::x86_64::CpuId;
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
#[cfg(target_arch = "x86_64")]
use crate::ClockData;
use crate::CreateDevice;
use crate::UserMemoryRegion;
@@ -324,10 +324,10 @@ pub trait Vm: Send + Sync {
#[cfg(target_arch = "x86_64")]
fn enable_sgx_attribute(&self, file: File) -> Result<()>;
/// Retrieve guest clock.
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
#[cfg(target_arch = "x86_64")]
fn get_clock(&self) -> Result<ClockData>;
/// Set guest clock.
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
#[cfg(target_arch = "x86_64")]
fn set_clock(&self, data: &ClockData) -> Result<()>;
#[cfg(feature = "kvm")]
/// Checks if a particular `Cap` is available.