mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Test trigger with valid vector fires interrupt
Verify that a valid in bounds vector with MSI-X enabled successfully triggers the interrupt source group. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
a682112851
commit
6be080c083
@@ -1398,4 +1398,12 @@ mod unit_tests {
|
||||
intr.queues_vectors.lock().unwrap()[0] = 0xFFFE;
|
||||
assert!(intr.notifier(VirtioInterruptType::Queue(0)).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trigger_with_valid_vector_fires() {
|
||||
let intr = make_msix_interrupt(2);
|
||||
intr.queues_vectors.lock().unwrap()[0] = 0;
|
||||
intr.msix_config.lock().unwrap().set_msg_ctl(1u16 << 15);
|
||||
intr.trigger(VirtioInterruptType::Queue(0)).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user