diff options
author | Jason Wang <jasowang@redhat.com> | 2015-04-23 14:21:34 +0800 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-07-28 18:22:35 -0500 |
commit | cf6c213981de2a54154b13fecee58e6cdc5aa504 (patch) | |
tree | d68db09785a68847c878200815ae5f4d7f56ee95 /hw/net | |
parent | cf3297868c57938028bfd2d8716f56c28a78d7e4 (diff) | |
download | qemu-cf6c213981de2a54154b13fecee58e6cdc5aa504.zip qemu-cf6c213981de2a54154b13fecee58e6cdc5aa504.tar.gz qemu-cf6c213981de2a54154b13fecee58e6cdc5aa504.tar.bz2 |
virtio-net: fix the upper bound when trying to delete queues
Virtqueue were indexed from zero, so don't delete virtqueue whose
index is n->max_queues * 2 + 1.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 27a46dcf5038e20451101ed2d5414aebf3846e27)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/virtio-net.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 59f76bc..b6fac9c 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1309,7 +1309,7 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue) n->multiqueue = multiqueue; - for (i = 2; i <= n->max_queues * 2 + 1; i++) { + for (i = 2; i < n->max_queues * 2 + 1; i++) { virtio_del_queue(vdev, i); } |