mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: provide a generic CpuState structure
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -59,12 +59,12 @@ pub use kvm::x86_64;
|
||||
pub use kvm::{aarch64, GicState};
|
||||
// Aliased types exposed from both hypervisors
|
||||
#[cfg(feature = "kvm")]
|
||||
pub use kvm::{ClockData, CpuState, CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VmState};
|
||||
pub use kvm::{ClockData, CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VmState};
|
||||
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
|
||||
pub use mshv::x86_64;
|
||||
// Aliased types exposed from both hypervisors
|
||||
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
|
||||
pub use mshv::{CpuState, CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VmState};
|
||||
pub use mshv::{CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VmState};
|
||||
use std::sync::Arc;
|
||||
pub use vm::{
|
||||
DataMatch, HypervisorVmError, InterruptSourceConfig, LegacyIrqSourceConfig, MsiIrqSourceConfig,
|
||||
@@ -144,3 +144,11 @@ pub enum IoEventAddress {
|
||||
Pio(u64),
|
||||
Mmio(u64),
|
||||
}
|
||||
|
||||
#[derive(Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum CpuState {
|
||||
#[cfg(feature = "kvm")]
|
||||
Kvm(kvm::VcpuKvmState),
|
||||
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
|
||||
Mshv(mshv::VcpuMshvState),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user