From patchwork Wed Feb 20 09:18:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 222018 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 1770E2C007C for ; Wed, 20 Feb 2013 20:27:24 +1100 (EST) Received: from localhost ([::1]:55428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U85xR-0007To-D8 for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 04:27:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U85xF-0007Ro-7H for qemu-devel@nongnu.org; Wed, 20 Feb 2013 04:27:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U85xB-0000mq-3j for qemu-devel@nongnu.org; Wed, 20 Feb 2013 04:27:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U85xA-0000mf-S9 for qemu-devel@nongnu.org; Wed, 20 Feb 2013 04:27:05 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1K9R3F3004185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Feb 2013 04:27:04 -0500 Received: from amd-6168-8-1.englab.nay.redhat.com (amd-6168-8-1.englab.nay.redhat.com [10.66.104.52]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1K9R193020131; Wed, 20 Feb 2013 04:27:02 -0500 From: Jason Wang To: aliguori@us.ibm.com, stefanha@redhat.com, qemu-devel@nongnu.org Date: Wed, 20 Feb 2013 17:18:08 +0800 Message-Id: <1361351888-45981-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang Subject: [Qemu-devel] [PATCH] 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 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. Signed-off-by: Jason Wang --- This patch is needed for 1.4 stable also. --- net/tap.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/tap.c b/net/tap.c index 48c254e..1e14f59 100644 --- a/net/tap.c +++ b/net/tap.c @@ -693,6 +693,12 @@ int net_init_tap(const NetClientOptions *opts, const char *name, queues = tap->has_queues ? tap->queues : 1; vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL; + if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) { + error_report("This configuration is not compatiable with multiqueue" + " tap"); + 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 ||