From patchwork Mon Jun 7 15:03:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 54876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8FD86B7D4A for ; Tue, 8 Jun 2010 01:16:29 +1000 (EST) Received: from localhost ([127.0.0.1]:50633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLe3n-0001MD-VA for incoming@patchwork.ozlabs.org; Mon, 07 Jun 2010 11:16:20 -0400 Received: from [140.186.70.92] (port=40561 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLdvX-0004rD-9F for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:07:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLdvU-0001C5-Qk for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:07:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62422) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLdvU-0001Bn-FN for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:07:44 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o57F7hG9014925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Jun 2010 11:07:43 -0400 Received: from redhat.com (vpn-6-161.tlv.redhat.com [10.35.6.161]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o57F7gDv032329 for ; Mon, 7 Jun 2010 11:07:42 -0400 Date: Mon, 7 Jun 2010 18:03:10 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <20100607150309.GA13369@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] configure: add an option to disable vlans X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With -netdev, there now seems to be little need to support vlans, enabling them leads to user confusion and bad performance. Disable support for vlans by default, add config option to enable. Signed-off-by: Michael S. Tsirkin --- configure | 12 ++++++++++++ net.c | 7 +++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 3cd2c5f..728d9a1 100755 --- a/configure +++ b/configure @@ -299,6 +299,7 @@ pkgversion="" check_utests="no" user_pie="no" zero_malloc="" +vlans="no" # OS specific if check_define __linux__ ; then @@ -660,6 +661,10 @@ for opt do ;; --enable-vhost-net) vhost_net="yes" ;; + --disable-vlans) vlans="no" + ;; + --enable-vlans) vlans="yes" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -826,6 +831,8 @@ echo " --enable-docs enable documentation build" echo " --disable-docs disable documentation build" echo " --disable-vhost-net disable vhost-net acceleration support" echo " --enable-vhost-net enable vhost-net acceleration support" +echo " --disable-vlans disable legacy qemu vlan support" +echo " --enable-vlans enable legacy qemu vlan support" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 @@ -2041,6 +2048,7 @@ echo "preadv support $preadv" echo "fdatasync $fdatasync" echo "uuid support $uuid" echo "vhost-net support $vhost_net" +echo "vlans support $vlans" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -2284,6 +2292,10 @@ bsd) ;; esac +if test $vlans = "yes" ; then + echo "CONFIG_VLANS=y" >> $config_target_mak +fi + tools= if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" diff --git a/net.c b/net.c index 378edfc..a6af5f7 100644 --- a/net.c +++ b/net.c @@ -1070,6 +1070,13 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) return -1; } +#ifndef CONFIG_VLANS + if (!is_netdev) { + qerror_report(QERR_INVALID_PARAMETER_VALUE, "netdev", "netdev id"); + return -1; + } +#endif + if (is_netdev) { if (strcmp(type, "tap") != 0 && #ifdef CONFIG_SLIRP