mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: trigger interrupt into guest on resume
This will wake up the guest and avoid a livelock situation by ensuring that it will process any pending queues on its side. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -384,6 +384,15 @@ impl Pausable for VirtioCommon {
|
||||
})?;
|
||||
}
|
||||
|
||||
// Also trigger interrupts into the guest to wake up the driver to avoid a "livelock"
|
||||
if let Some(interrupt_cb) = &self.interrupt_cb {
|
||||
for i in 0..self.queue_evts.len() {
|
||||
interrupt_cb
|
||||
.trigger(crate::VirtioInterruptType::Queue(i as u16))
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user