From 2b466ed80c3c4874791b43aa0c50f9e71a3eacfc Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Sat, 27 Jun 2020 16:08:03 +0000 Subject: [PATCH] vmm: interrupt: provide MsiInterruptGroupOps trait Currently it only contains a function named set_gsi_routes. Signed-off-by: Wei Liu --- vmm/src/interrupt.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vmm/src/interrupt.rs b/vmm/src/interrupt.rs index 6e4cb4494..01769f71a 100644 --- a/vmm/src/interrupt.rs +++ b/vmm/src/interrupt.rs @@ -116,6 +116,10 @@ struct MsiInterruptGroup { irq_routes: HashMap, } +trait MsiInterruptGroupOps { + fn set_gsi_routes(&self) -> Result<()>; +} + trait RoutingEntryExt { fn make_entry(gsi: u32, config: &InterruptSourceConfig) -> Result>; } @@ -164,7 +168,7 @@ impl MsiInterruptGroup { type KvmMsiInterruptGroup = MsiInterruptGroup; -impl KvmMsiInterruptGroup { +impl MsiInterruptGroupOps for KvmMsiInterruptGroup { fn set_gsi_routes(&self) -> Result<()> { let gsi_msi_routes = self.gsi_msi_routes.lock().unwrap(); let mut entry_vec: Vec = Vec::new();