mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: add create_passthrough_device call to Vm trait
That function is going to return a handle for passthrough related operations. Move create_kvm_device code there. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -110,6 +110,11 @@ pub enum HypervisorVmError {
|
||||
///
|
||||
#[error("Failed to set clock: {0}")]
|
||||
SetClock(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create passthrough device
|
||||
///
|
||||
#[error("Failed to create passthrough device: {0}")]
|
||||
CreatePassthroughDevice(#[source] anyhow::Error),
|
||||
}
|
||||
///
|
||||
/// Result type for returning from a function
|
||||
@@ -171,4 +176,6 @@ pub trait Vm: Send + Sync {
|
||||
fn set_clock(&self, data: &ClockData) -> Result<()>;
|
||||
/// Checks if a particular `Cap` is available.
|
||||
fn check_extension(&self, c: Cap) -> bool;
|
||||
/// Create a device that is used for passthrough
|
||||
fn create_passthrough_device(&self) -> Result<DeviceFd>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user