From 088b1363e7aa0a8b3d72239296c0fe3af165b562 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 4 May 2026 22:08:54 +0200 Subject: [PATCH] virtio-devices: Test trigger with NO_VECTOR returns Ok Verify that triggering an interrupt when the vector is set to VIRTQ_MSI_NO_VECTOR short-circuits and returns Ok. Signed-off-by: Anatol Belski --- virtio-devices/src/transport/pci_device.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/virtio-devices/src/transport/pci_device.rs b/virtio-devices/src/transport/pci_device.rs index b8b3b6835..2c231e666 100644 --- a/virtio-devices/src/transport/pci_device.rs +++ b/virtio-devices/src/transport/pci_device.rs @@ -1385,4 +1385,10 @@ mod unit_tests { intr.queues_vectors.lock().unwrap()[0] = 0xFFFE; intr.trigger(VirtioInterruptType::Queue(0)).unwrap(); } + + #[test] + fn trigger_with_no_vector_returns_ok() { + let intr = make_msix_interrupt(2); + intr.trigger(VirtioInterruptType::Queue(0)).unwrap(); + } }