mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: interrupt: generify impl InterruptSourceGroup for MsiInterruptGroup
At this point we can use the same logic for all hypervisor implementations. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -200,7 +200,12 @@ impl MsiInterruptGroupOps for KvmMsiInterruptGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InterruptSourceGroup for KvmMsiInterruptGroup {
|
impl<E> InterruptSourceGroup for MsiInterruptGroup<E>
|
||||||
|
where
|
||||||
|
E: Send + Sync,
|
||||||
|
RoutingEntry<E>: RoutingEntryExt,
|
||||||
|
MsiInterruptGroup<E>: MsiInterruptGroupOps,
|
||||||
|
{
|
||||||
fn enable(&self) -> Result<()> {
|
fn enable(&self) -> Result<()> {
|
||||||
for (_, route) in self.irq_routes.iter() {
|
for (_, route) in self.irq_routes.iter() {
|
||||||
route.enable(&self.vm_fd)?;
|
route.enable(&self.vm_fd)?;
|
||||||
@@ -238,7 +243,7 @@ impl InterruptSourceGroup for KvmMsiInterruptGroup {
|
|||||||
|
|
||||||
fn update(&self, index: InterruptIndex, config: InterruptSourceConfig) -> Result<()> {
|
fn update(&self, index: InterruptIndex, config: InterruptSourceConfig) -> Result<()> {
|
||||||
if let Some(route) = self.irq_routes.get(&index) {
|
if let Some(route) = self.irq_routes.get(&index) {
|
||||||
let entry = KvmRoutingEntry::make_entry(route.gsi, &config)?;
|
let entry = RoutingEntry::<_>::make_entry(route.gsi, &config)?;
|
||||||
self.gsi_msi_routes
|
self.gsi_msi_routes
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|||||||
Reference in New Issue
Block a user