mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Test notifier with OOB vector returns None
Verify that requesting a notifier with an out-of-bounds MSI-X vector returns None instead of panicking. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
088b1363e7
commit
a682112851
@@ -1391,4 +1391,11 @@ mod unit_tests {
|
||||
let intr = make_msix_interrupt(2);
|
||||
intr.trigger(VirtioInterruptType::Queue(0)).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn notifier_with_oob_vector_returns_none() {
|
||||
let intr = make_msix_interrupt(2);
|
||||
intr.queues_vectors.lock().unwrap()[0] = 0xFFFE;
|
||||
assert!(intr.notifier(VirtioInterruptType::Queue(0)).is_none());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user