From 656b9f97f98f78686b5c80193e89c0a9481c008c Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 5 May 2021 08:22:33 +0100 Subject: [PATCH] virtio-devices: net: Loop over enabled queue pairs when activating In some situations (booting with OVMF) fewer queues will be enabled therefore we should iterate over the number of enabled queues (as passed into VirtioDevice::activate()) rather than the number of create tap devices. Fixes: #2578 Signed-off-by: Rob Bradford --- virtio-devices/src/net.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index c8d7a89db..165459aed 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -546,7 +546,7 @@ impl VirtioDevice for Net { let mut epoll_threads = Vec::new(); let mut taps = self.taps.clone(); - for i in 0..taps.len() { + for i in 0..queues.len() / 2 { let rx = RxVirtio::new(); let tx = TxVirtio::new(); let rx_tap_listening = false;