]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: eliminate useless WITH_VIRTUALPORT check
authorLaine Stump <laine@redhat.com>
Mon, 28 Sep 2020 21:39:46 +0000 (17:39 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 1 Oct 2020 18:02:34 +0000 (14:02 -0400)
WITH_VIRTUALPORT just checks that we are building on Linux and that
IFLA_PORT_MAX is defined in linux/if_link.h. Back when 802.11Qb[gh]
support was added, the IFLA_* stuff was new (introduced in kernel
2.6.35, backported to RHEL6 2.6.32 kernel at some point), and so this
extra check was necessary, because libvirt was being built on Linux
distros that didn't yet have IFLA_* (e.g. older RHEL6, all
RHEL5). It's been in the kernel for a *very* long time now, so all
supported versions of all Linux platforms libvirt builds on have it.

Note that the above paragraph implies that the conditional compilation
should be changed to #if defined(__linux__). However, the astute
reader will notice that the code in question is sending and receiving
netlink messages, so it really should be conditional on WITH_LIBNL
(which implies __linux__) instead, so that's what this patch does.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
meson.build
meson_options.txt
src/util/virnetdevvportprofile.c
tools/virsh.c

index bdceb16cf0da30575f45fddc411b4b86385f9cb0..d362b9027b4bd83767269dbaf2cf66c8aa8c9913 100644 (file)
@@ -1386,14 +1386,6 @@ endif
 
 util_dep = cc.find_library('util', required: false)
 
-if not get_option('virtualport').disabled()
-  if cc.has_header_symbol('linux/if_link.h', 'IFLA_PORT_MAX')
-    conf.set('WITH_VIRTUALPORT', 1)
-  elif get_option('virtualport').enabled()
-    error('Installed linux headers don\'t show support for virtual port support.')
-  endif
-endif
-
 if host_machine.system() == 'windows'
   ole32_dep = cc.find_library('ole32')
   oleaut32_dep = cc.find_library('oleaut32')
index 74de06438419f64e8a636d8ea092fe19a79b6364..ddd90916c86c737fd442338b0d2babd2772702d8 100644 (file)
@@ -39,7 +39,6 @@ option('sasl', type: 'feature', value: 'auto', description: 'sasl support')
 option('selinux', type: 'feature', value: 'auto', description: 'selinux support')
 option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point')
 option('udev', type: 'feature', value: 'auto', description: 'udev support')
-option('virtualport', type: 'feature', value: 'auto', description: 'enable virtual port support')
 option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support')
 option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin')
 option('yajl', type: 'feature', value: 'auto', description: 'yajl support')
index 020683fa04d57520a2484b340ebb39d1c737ffc1..5dae8aa57d0cf5a76cbc0fdb90861ebb0a3b35d3 100644 (file)
@@ -46,7 +46,7 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
               "no-op",
 );
 
-#if WITH_VIRTUALPORT
+#if defined(WITH_LIBNL)
 
 # include <fcntl.h>
 
@@ -454,7 +454,7 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
 }
 
 
-#if WITH_VIRTUALPORT
+#if defined(WITH_LIBNL)
 
 static struct nla_policy ifla_port_policy[IFLA_PORT_MAX + 1] =
 {
@@ -1343,7 +1343,7 @@ virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
     return rc;
 }
 
-#else /* ! WITH_VIRTUALPORT */
+#else /* !WITH_LIBNL */
 int virNetDevVPortProfileAssociate(const char *macvtap_ifname G_GNUC_UNUSED,
                                    const virNetDevVPortProfile *virtPort G_GNUC_UNUSED,
                                    const virMacAddr *macvtap_macaddr G_GNUC_UNUSED,
@@ -1369,4 +1369,4 @@ int virNetDevVPortProfileDisassociate(const char *macvtap_ifname G_GNUC_UNUSED,
                          _("Virtual port profile association not supported on this platform"));
     return -1;
 }
-#endif /* ! WITH_VIRTUALPORT */
+#endif /* !WITH_LIBNL */
index ac9b7ad2385f32f45acb09e2eedf7dec7c19fe60..954778b6268989e1ac934023965d980c70b2fdd6 100644 (file)
@@ -548,9 +548,6 @@ virshShowVersion(vshControl *ctl G_GNUC_UNUSED)
 #endif
 #ifdef WITH_NWFILTER
     vshPrint(ctl, " Nwfilter");
-#endif
-#ifdef WITH_VIRTUALPORT
-    vshPrint(ctl, " VirtualPort");
 #endif
     vshPrint(ctl, "\n");