mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-20 15:01:16 +00:00
vmm: interrupt: provide MsiInterruptGroupOps trait
Currently it only contains a function named set_gsi_routes. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
b2abead65b
commit
2b466ed80c
@ -116,6 +116,10 @@ struct MsiInterruptGroup<E> {
|
|||||||
irq_routes: HashMap<InterruptIndex, InterruptRoute>,
|
irq_routes: HashMap<InterruptIndex, InterruptRoute>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trait MsiInterruptGroupOps {
|
||||||
|
fn set_gsi_routes(&self) -> Result<()>;
|
||||||
|
}
|
||||||
|
|
||||||
trait RoutingEntryExt {
|
trait RoutingEntryExt {
|
||||||
fn make_entry(gsi: u32, config: &InterruptSourceConfig) -> Result<Box<Self>>;
|
fn make_entry(gsi: u32, config: &InterruptSourceConfig) -> Result<Box<Self>>;
|
||||||
}
|
}
|
||||||
@ -164,7 +168,7 @@ impl<E> MsiInterruptGroup<E> {
|
|||||||
|
|
||||||
type KvmMsiInterruptGroup = MsiInterruptGroup<kvm_irq_routing_entry>;
|
type KvmMsiInterruptGroup = MsiInterruptGroup<kvm_irq_routing_entry>;
|
||||||
|
|
||||||
impl KvmMsiInterruptGroup {
|
impl MsiInterruptGroupOps for KvmMsiInterruptGroup {
|
||||||
fn set_gsi_routes(&self) -> Result<()> {
|
fn set_gsi_routes(&self) -> Result<()> {
|
||||||
let gsi_msi_routes = self.gsi_msi_routes.lock().unwrap();
|
let gsi_msi_routes = self.gsi_msi_routes.lock().unwrap();
|
||||||
let mut entry_vec: Vec<kvm_irq_routing_entry> = Vec::new();
|
let mut entry_vec: Vec<kvm_irq_routing_entry> = Vec::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user