mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: Introduce VM state to Vm hypervisor trait
We may need to store hypervisor speciific data to the VM. This support is needed for Microsoft hyperv implementations. This patch introduces two new definitions to Vm trait and implements for KVM. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
8962e25268
commit
77e901a602
@@ -14,6 +14,7 @@ use crate::cpu::Vcpu;
|
||||
use crate::device::Device;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
use crate::ClockData;
|
||||
use crate::KvmVmState as VmState;
|
||||
use crate::{CreateDevice, IoEventAddress, IrqRoutingEntry, MemoryRegion};
|
||||
use kvm_ioctls::Cap;
|
||||
use std::sync::Arc;
|
||||
@@ -179,4 +180,8 @@ pub trait Vm: Send + Sync {
|
||||
fn check_extension(&self, c: Cap) -> bool;
|
||||
/// Create a device that is used for passthrough
|
||||
fn create_passthrough_device(&self) -> Result<Arc<dyn Device>>;
|
||||
/// Get the Vm state. Return VM specific data
|
||||
fn state(&self) -> Result<VmState>;
|
||||
/// Set the VM state
|
||||
fn set_state(&self, state: &VmState) -> Result<()>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user