]> xenbits.xensource.com Git - libvirt.git/commitdiff
m4: virt-libnl: drop libnl-1.0 support
authorPavel Hrdina <phrdina@redhat.com>
Wed, 9 Oct 2019 12:36:32 +0000 (14:36 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 23 Oct 2019 12:30:47 +0000 (14:30 +0200)
All supported OSes have libnl-3.0 and netcf uses it so there is no need
to keep libnl-1.0 compatibility code.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
m4/virt-libnl.m4
src/util/virnetlink.c
src/util/virnetlink.h

index c106d545ec822c65b16329b17dc376a440be749e..cd780cf90e708ddfaa67c58d2db6d264b4b174b4 100644 (file)
@@ -18,56 +18,22 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_DEFUN([LIBVIRT_CHECK_LIBNL], [
-  AC_REQUIRE([LIBVIRT_CHECK_NETCF])
   AC_REQUIRE([LIBVIRT_CHECK_MACVTAP])
 
-  LIBNL_REQUIRED="1.1"
   with_libnl=no
 
   if test "$with_linux" = "yes"; then
-    # When linking with netcf, we must ensure that we pick the same version
-    # of libnl that netcf picked.  Prefer libnl-3 unless we can prove
-    # netcf linked against libnl-1, or unless the user set LIBNL_CFLAGS.
-    # (Setting LIBNL_CFLAGS is already used by PKG_CHECK_MODULES to
-    # override any probing, so if it set, you know which libnl is in use.)
-    libnl_ldd=
-    for dir in /usr/lib64 /usr/lib /usr/lib/*-linux-gnu*; do
-      if test -f $dir/libnetcf.so; then
-        libnl_ldd=`(ldd $dir/libnetcf.so) 2>&1`
-        break
-      fi
-    done
-    case $libnl_ldd:${LIBNL_CFLAGS+set} in
-      *libnl-3.so.*:) LIBNL_REQUIRED=3.0 ;;
-    esac
-    case $libnl_ldd:${LIBNL_CFLAGS+set} in
-      *libnl.so.1*:) ;;
-      *)
-        PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [
-          with_libnl=yes
-          AC_DEFINE([HAVE_LIBNL3], [1], [Use libnl-3.0])
-          AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available])
-          PKG_CHECK_MODULES([LIBNL_ROUTE3], [libnl-route-3.0])
-          LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE3_CFLAGS"
-          LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE3_LIBS"
-        ], [:]) ;;
-    esac
-    if test "$with_libnl" = no; then
-      PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [
-        with_libnl=yes
-        AC_DEFINE_UNQUOTED([HAVE_LIBNL], [1],
-          [whether the netlink library is available])
-        AC_DEFINE_UNQUOTED([HAVE_LIBNL1], [1],
-          [whether the netlink v1 library is available])
-      ], [
-        if test "$with_macvtap" = "yes"; then
-          if test "$LIBNL_REQUIRED" = "3.0";then
-            AC_MSG_ERROR([libnl3-devel >= $LIBNL_REQUIRED is required for macvtap support])
-          else
-            AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support])
-          fi
-        fi
-      ])
+    PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [
+      with_libnl=yes
+      AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available])
+      PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0])
+      LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE_CFLAGS"
+      LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE_LIBS"
+    ], [:])
+  fi
+  if test "$with_libnl" = no; then
+    if test "$with_macvtap" = "yes"; then
+        AC_MSG_ERROR([libnl3-devel is required for macvtap support])
     fi
   fi
   AM_CONDITIONAL([HAVE_LIBNL], [test "$with_libnl" = "yes"])
index ab41b57672733d056b8a65b35120b0d3a011de80..0d91503714d51bf52e50fb685fe3738554fc289f 100644 (file)
@@ -52,17 +52,10 @@ struct virNetlinkEventHandle {
     int deleted;
 };
 
-# ifdef HAVE_LIBNL1
-#  define virNetlinkAlloc nl_handle_alloc
-#  define virNetlinkSetBufferSize nl_set_buffer_size
-#  define virNetlinkFree nl_handle_destroy
-typedef struct nl_handle virNetlinkHandle;
-# else
-#  define virNetlinkAlloc nl_socket_alloc
-#  define virNetlinkSetBufferSize nl_socket_set_buffer_size
-#  define virNetlinkFree nl_socket_free
+# define virNetlinkAlloc nl_socket_alloc
+# define virNetlinkSetBufferSize nl_socket_set_buffer_size
+# define virNetlinkFree nl_socket_free
 typedef struct nl_sock virNetlinkHandle;
-# endif
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkHandle, virNetlinkFree);
 
index 030547e573e6e60b95b1f573d8612895d957fb4f..e888857601285a41a3aab73e4e71106d5ce79981 100644 (file)
 
 #if defined(__linux__) && defined(HAVE_LIBNL)
 
-/* Work around a bug where older libnl-1 headers expected older gcc
- * semantics of 'extern inline' that conflict with C99 semantics.  */
-# ifdef HAVE_LIBNL1
-#  define inline
-# endif
 # include <netlink/msg.h>
-# ifdef HAVE_LIBNL1
-#  undef inline
-# endif
 
 typedef struct nl_msg virNetlinkMsg;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkMsg, nlmsg_free);