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 <m...@redhat.com> --- 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 -- 1.7.1.12.g42b7f