hypervisor: Move creation of irq routing struct to hypervisor crate

This removes the requirement to leak as many datastructures from the
hypervisor crate into the vmm crate.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-05-10 16:47:34 +01:00
parent fe82322727
commit 3f9e8d676a
6 changed files with 98 additions and 85 deletions

View File

@@ -28,6 +28,7 @@ use kvm_ioctls::Cap;
use std::fs::File;
use std::sync::Arc;
use thiserror::Error;
use vm_device::interrupt::InterruptSourceConfig;
use vmm_sys_util::eventfd::EventFd;
///
@@ -245,6 +246,8 @@ pub trait Vm: Send + Sync {
) -> Result<()>;
/// Unregister an event from a certain address it has been previously registered to.
fn unregister_ioevent(&self, fd: &EventFd, addr: &IoEventAddress) -> Result<()>;
// Construct a routing entry
fn make_routing_entry(&self, gsi: u32, config: &InterruptSourceConfig) -> IrqRoutingEntry;
/// Sets the GSI routing table entries, overwriting any previously set
fn set_gsi_routing(&self, entries: &[IrqRoutingEntry]) -> Result<()>;
/// Creates a memory region structure that can be used with {create/remove}_user_memory_region