mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: Retrieve list of supported MSRs
Add a new function to the hypervisor trait so that the caller can retrieve the list of MSRs supported by this hypervisor. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
e2b5c78dc5
commit
49b4fba283
@@ -9,7 +9,7 @@
|
||||
//
|
||||
use crate::vm::Vm;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use crate::x86_64::CpuId;
|
||||
use crate::x86_64::{CpuId, MsrList};
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use kvm_ioctls::Cap;
|
||||
use std::sync::Arc;
|
||||
@@ -55,6 +55,11 @@ pub enum HypervisorError {
|
||||
///
|
||||
#[error("Failed to get number of max vcpus: {0}")]
|
||||
GetCpuId(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to retrieve list of MSRs.
|
||||
///
|
||||
#[error("Failed to get the list of supported MSRs: {0}")]
|
||||
GetMsrList(#[source] anyhow::Error),
|
||||
}
|
||||
|
||||
///
|
||||
@@ -103,4 +108,9 @@ pub trait Hypervisor: Send + Sync {
|
||||
/// Check particular extensions if any
|
||||
///
|
||||
fn check_required_extensions(&self) -> Result<()>;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
///
|
||||
/// Retrieve the list of MSRs supported by the hypervisor.
|
||||
///
|
||||
fn get_msr_list(&self) -> Result<MsrList>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user