]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: eliminate WITH_MACVTAP flag entirely
authorLaine Stump <laine@redhat.com>
Tue, 29 Sep 2020 14:54:38 +0000 (10:54 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 1 Oct 2020 18:02:34 +0000 (14:02 -0400)
This flag was originally created to indicate that either 1) the build
platform wasn't linux, 2) the build platform was linux, but the kernel
was too old to have macvtap support. Since there was already a switch
there, the ability to also disable it when 3) the kernel supports
macvtap but the user doesn't want it, was added in. I don't think that
(3) was ever an intentional goal, just something that grew naturally
out of having the flag there in the first place (unless possibly the
original author wanted a way to quickly disable their new code in case
it caused regressions elsewhere).

Now that the check for (2) has been removed, WITH_MACVTAP is just
checking (1) and (3), but (3) is pointless (because the extra code in
libvirt itself is miniscule, and the only external library needed for
it is libnl, which is also required for other unrelated features (and
itself has no subordinate dependencies and takes up < 1MB on
disk)). We can therfore eliminate the WITH_MACVTAP flag, as it is
functionally equivalent to WITH_LIBNL (which implies __linux__).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
libvirt.spec.in
meson.build
meson_options.txt
src/util/virnetdevmacvlan.c

index c4a7c30737565eb578de5d68590f0b86e26e9682..aa2bc84be99f57b4f0f73cd1b13d5267111043e3 100644 (file)
@@ -1167,7 +1167,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
            -Dyajl=enabled \
            %{?arg_sanlock} \
            -Dlibpcap=enabled \
-           -Dmacvtap=enabled \
            -Daudit=enabled \
            -Ddtrace=enabled \
            %{?arg_firewalld} \
index 512269e83d33643487895539102c87278f688d01..08aa827ca260cea7a109ceb483a2e5638f55f338 100644 (file)
@@ -1159,16 +1159,6 @@ libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version)
 cc = meson.get_compiler('c')
 m_dep = cc.find_library('m', required : false)
 
-if host_machine.system() == 'linux'
-  if not get_option('macvtap').disabled()
-    conf.set('WITH_MACVTAP', 1)
-  endif
-else
-  if get_option('macvtap').enabled()
-    error('macvtap is not supported on this platform.')
-  endif
-endif
-
 netcf_version = '0.1.8'
 netcf_dep = dependency('netcf', version: '>=' + netcf_version, required: get_option('netcf'))
 if netcf_dep.found()
index ddd90916c86c737fd442338b0d2babd2772702d8..359fcf0a0b36d2c9a443a8239cef723377d96c6c 100644 (file)
@@ -26,7 +26,6 @@ option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi suppor
 option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support')
 option('libssh', type: 'feature', value: 'auto', description: 'libssh support')
 option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support')
-option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device')
 option('netcf', type: 'feature', value: 'auto', description: 'netcf support')
 option('nls', type: 'feature', value: 'auto', description: 'nls support')
 option('numactl', type: 'feature', value: 'auto', description: 'numactl support')
index c4c6eeaffc2cd0108050ce9c26851194544b7eda..34bc0b90bd37ed62149a468e9261629c03b0782f 100644 (file)
@@ -40,7 +40,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
               "passthrough",
 );
 
-#if WITH_MACVTAP
+#if defined(WITH_LIBNL)
 # include <fcntl.h>
 
 # include <net/if.h>
@@ -1043,7 +1043,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
 
 }
 
-#else /* ! WITH_MACVTAP */
+#else /* ! WITH_LIBNL */
 bool virNetDevMacVLanIsMacvtap(const char *ifname G_GNUC_UNUSED)
 {
     virReportSystemError(ENOSYS, "%s",
@@ -1149,4 +1149,4 @@ void virNetDevMacVLanReserveName(const char *name G_GNUC_UNUSED)
     virReportSystemError(ENOSYS, "%s",
                          _("Cannot create macvlan devices on this platform"));
 }
-#endif /* ! WITH_MACVTAP */
+#endif /* ! WITH_LIBNL */