From: Laine Stump Date: Tue, 29 Sep 2020 14:54:38 +0000 (-0400) Subject: build: eliminate WITH_MACVTAP flag entirely X-Git-Tag: v6.9.0-rc1~415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7556ab139fd2e503ac26ee232ab273f1ec027c21;p=thirdparty%2Flibvirt.git build: eliminate WITH_MACVTAP flag entirely 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 Reviewed-by: Michal Privoznik --- diff --git a/libvirt.spec.in b/libvirt.spec.in index c4a7c30737..aa2bc84be9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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} \ diff --git a/meson.build b/meson.build index 512269e83d..08aa827ca2 100644 --- a/meson.build +++ b/meson.build @@ -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() diff --git a/meson_options.txt b/meson_options.txt index ddd90916c8..359fcf0a0b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index c4c6eeaffc..34bc0b90bd 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -40,7 +40,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, "passthrough", ); -#if WITH_MACVTAP +#if defined(WITH_LIBNL) # include # include @@ -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 */