From patchwork Thu Mar 5 05:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 446612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D27D214015A for ; Thu, 5 Mar 2015 16:49:55 +1100 (AEDT) Received: from localhost ([::1]:48435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTOfS-0005mT-3W for incoming@patchwork.ozlabs.org; Thu, 05 Mar 2015 00:49:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTOer-0005i2-EQ for qemu-devel@nongnu.org; Thu, 05 Mar 2015 00:49:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTOep-0001uA-TW for qemu-devel@nongnu.org; Thu, 05 Mar 2015 00:49:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTOep-0001u1-M6 for qemu-devel@nongnu.org; Thu, 05 Mar 2015 00:49:15 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t255nEKv012845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 5 Mar 2015 00:49:14 -0500 Received: from jason-ThinkPad-T430s.nay.redhat.com ([10.66.70.106]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t255mx47006801; Thu, 5 Mar 2015 00:49:10 -0500 From: Jason Wang To: qemu-devel@nongnu.org Date: Thu, 5 Mar 2015 13:48:39 +0800 Message-Id: <1425534531-6305-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1425534531-6305-1-git-send-email-jasowang@redhat.com> References: <1425534531-6305-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , Anthony Liguori , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH V3 02/14] virtio-net: fix the upper bound when trying to delete queues X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Virtqueue were indexed from zero, so don't delete virtqueue whose index is n->max_queues * 2 + 1. Cc: Anthony Liguori Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index b4ac2b3..c8d2cca 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1306,7 +1306,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); }