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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-05-05 08:22:33 +01:00 committed by Sebastien Boeuf
parent db66cb6e9b
commit 656b9f97f9

View File

@ -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;