]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: simplify check for WITH_MACVTAP
authorLaine Stump <laine@redhat.com>
Tue, 29 Sep 2020 13:56:18 +0000 (09:56 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 1 Oct 2020 18:02:34 +0000 (14:02 -0400)
macvtap support was added to the Linux kernel in 2.6.33. libvirt
checked for this by looking for MACVLAN_MODE_BRIDGE and IFLA_VF_MAX in
linux/if_link.h. This hasn't been necessary for a very long time, so
just gate on platform == 'linux' (and be sure to complain if someone
tries to enable it on a non-Linux platform).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
meson.build

index 50b06c323a91f70bec24c2b77f04ea734588b7ff..512269e83d33643487895539102c87278f688d01 100644 (file)
@@ -1159,20 +1159,15 @@ libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version)
 cc = meson.get_compiler('c')
 m_dep = cc.find_library('m', required : false)
 
-use_macvtap = false
-if not get_option('macvtap').disabled()
-  if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and
-      cc.has_header_symbol('linux/if_link.h', 'IFLA_VF_MAX'))
-    use_macvtap = true
+if host_machine.system() == 'linux'
+  if not get_option('macvtap').disabled()
+    conf.set('WITH_MACVTAP', 1)
   endif
-
-  if get_option('macvtap').enabled() and not use_macvtap
-    error('Installed linux headers don\'t show support for macvtap device.')
+else
+  if get_option('macvtap').enabled()
+    error('macvtap is not supported on this platform.')
   endif
 endif
-if use_macvtap
-  conf.set('WITH_MACVTAP', 1)
-endif
 
 netcf_version = '0.1.8'
 netcf_dep = dependency('netcf', version: '>=' + netcf_version, required: get_option('netcf'))