Skip to content
Commit ddbeac07 authored by Wei Wang's avatar Wei Wang Committed by Michael S. Tsirkin
Browse files

virtio_pci: use queue idx instead of array idx to set up the vq



When find_vqs, there will be no vq[i] allocation if its corresponding
names[i] is NULL. For example, the caller may pass in names[i] (i=4)
with names[2] being NULL because the related feature bit is turned off,
so technically there are 3 queues on the device, and name[4] should
correspond to the 3rd queue on the device.

So we use queue_idx as the queue index, which is increased only when the
queue exists.

Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
parent d1c1dad8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment