From patchwork Wed Feb 27 15:22:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 223636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C52132C007C for ; Thu, 28 Feb 2013 02:25:39 +1100 (EST) Received: from localhost ([::1]:39375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAisz-0000Wr-CO for incoming@patchwork.ozlabs.org; Wed, 27 Feb 2013 10:25:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAiq7-000433-J9 for qemu-devel@nongnu.org; Wed, 27 Feb 2013 10:22:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAiq4-0007jT-33 for qemu-devel@nongnu.org; Wed, 27 Feb 2013 10:22:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAiq3-0007jD-QM; Wed, 27 Feb 2013 10:22:36 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1RFMZsE001804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Feb 2013 10:22:35 -0500 Received: from localhost (ovpn-112-39.ams2.redhat.com [10.36.112.39]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1RFMYeP006022; Wed, 27 Feb 2013 10:22:34 -0500 From: Stefan Hajnoczi To: Date: Wed, 27 Feb 2013 16:22:21 +0100 Message-Id: <1361978545-13789-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1361978545-13789-1-git-send-email-stefanha@redhat.com> References: <1361978545-13789-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Jason Wang , Stefan Hajnoczi , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 3/7] tap: forbid creating multiqueue tap when hub is used 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 From: Jason Wang Obviously, hub does not support multiqueue tap. So this patch forbids creating multiple queue tap when hub is used to prevent the crash when command line such as "-net tap,queues=2" is used. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang Signed-off-by: Stefan Hajnoczi --- net/tap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/tap.c b/net/tap.c index 48c254e..daab350 100644 --- a/net/tap.c +++ b/net/tap.c @@ -693,6 +693,13 @@ int net_init_tap(const NetClientOptions *opts, const char *name, queues = tap->has_queues ? tap->queues : 1; vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL; + /* QEMU vlans does not support multiqueue tap, in this case peer is set. + * For -netdev, peer is always NULL. */ + if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) { + error_report("Multiqueue tap cannnot be used with QEMU vlans"); + return -1; + } + if (tap->has_fd) { if (tap->has_ifname || tap->has_script || tap->has_downscript || tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||