[virtio] Cap queue size to MAX_QUEUE_NUM
authorLadi Prosek <lprosek@redhat.com>
Fri, 16 Dec 2016 09:54:32 +0000 (10:54 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 22 Jan 2017 13:18:28 +0000 (13:18 +0000)
commite45451c6994f6e93729ee3860e45fa965483356f
tree42a29a9d741bedf9e99aec7e84723c6dc12dcb55
parentdfbbc16ae392e8f4ab62e15a99cdfb32a06af557
[virtio] Cap queue size to MAX_QUEUE_NUM

vpm_find_vqs incorrectly accepted the host provided queue size with no
regard to iPXE's internal limitations. Virtio 1.0 makes it possible for
the driver to override the queue size to reduce memory requirements and
iPXE is a great use case for this feature.

Also removing the extra vq->vring.num assignment which is already
handled in vring_init.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/virtio-pci.c
src/include/ipxe/virtio-ring.h