mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
vm-virtio: Don't trigger an MSI-X interrupt if not enabled
Relying on the newly added MSI-X helper, the interrupt callback checks the interrupts are enabled on the device before to try triggering the interrupt. Fixes #156 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
c0e2bbb23f
commit
aa44726658
@ -423,6 +423,12 @@ impl PciDevice for VirtioPciDevice {
|
||||
let config = &mut msix_config_clone.lock().unwrap();
|
||||
let entry = &config.table_entries[vector as usize];
|
||||
|
||||
// If MSI-X interrupts are not enabled for this device, then simply
|
||||
// ignore the interrupt.
|
||||
if !config.enabled() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// In case the vector control register associated with the entry
|
||||
// has its first bit set, this means the vector is masked and the
|
||||
// device should not inject the interrupt.
|
||||
|
Loading…
Reference in New Issue
Block a user