diff options
author | Jason Wang <jasowang@redhat.com> | 2015-04-23 14:21:34 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-04-27 20:49:45 +0200 |
commit | 27a46dcf5038e20451101ed2d5414aebf3846e27 (patch) | |
tree | 054969c217d461cb4e5de39b37f67eb40be0585d /hw/net | |
parent | 294ce717e0f212ed0763307f3eab72b4a1bdf4d0 (diff) | |
download | qemu-27a46dcf5038e20451101ed2d5414aebf3846e27.zip qemu-27a46dcf5038e20451101ed2d5414aebf3846e27.tar.gz qemu-27a46dcf5038e20451101ed2d5414aebf3846e27.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>
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); } |