[PATCH] Fix compilation on non-macvtap systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The refactoring in 6a5978833a5 and df3d8c362d3 was incomplete
as it accidentally moved macvtap related code out of a
#if WITH_MACVTAP in a #if __linux__ block. To fix this move
ifaceMacvtapLinkAdd and ifaceMacvtapLinkDump back under
#if WITH_MACVTAP.

Also nlComm was moved from #if WITH_MACVTAP to #if __linux__
but configure.ac was not updated to match this, as libnl is
now required on Linux always because of this.

Also related to libnl, libvirt_lxc missed LIBNL_CFLAGS in it's
CFLAGS.
---
 configure.ac         |    6 +++---
 src/Makefile.am      |    1 +
 src/util/interface.c |    6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index f816696..4c81e3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2372,10 +2372,10 @@ dnl netlink library
 LIBNL_CFLAGS=""
 LIBNL_LIBS=""
 
-if test "$with_macvtap" = "yes"; then
+if test "$with_linux" = "yes"; then
     PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [
     ], [
-        AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required for macvtap support])
+        AC_MSG_ERROR([libnl-devel >= $LIBNL_REQUIRED is required])
     ])
 fi
 
@@ -2574,7 +2574,7 @@ AC_MSG_NOTICE([    pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
 else
 AC_MSG_NOTICE([    pcap: no])
 fi
-if test "$with_macvtap" = "yes" ; then
+if test "$with_linux" = "yes" ; then
 AC_MSG_NOTICE([      nl: $LIBNL_CFLAGS $LIBNL_LIBS])
 else
 AC_MSG_NOTICE([      nl: no])
diff --git a/src/Makefile.am b/src/Makefile.am
index b292f9f..9e69f37 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1243,6 +1243,7 @@ libvirt_lxc_CFLAGS =				\
 		$(CAPNG_CFLAGS)			\
 		$(YAJL_CFLAGS)			\
 		$(AUDIT_CFLAGS)			\
+		$(LIBNL_CFLAGS)			\
 		-I@top_srcdir@/src/conf		\
 		$(AM_CFLAGS)
 endif
diff --git a/src/util/interface.c b/src/util/interface.c
index 02544d9..03f9367 100644
--- a/src/util/interface.c
+++ b/src/util/interface.c
@@ -494,7 +494,7 @@ ifaceSetMacaddr(const char *ifname ATTRIBUTE_UNUSED,
 
 
 /**
- * ifaceLinkAdd
+ * ifaceMacvtapLinkAdd
  *
  * @type: The type of device, i.e., "macvtap"
  * @macaddress: The MAC address of the device
@@ -510,7 +510,7 @@ ifaceSetMacaddr(const char *ifname ATTRIBUTE_UNUSED,
  *
  * Returns 0 on success, -1 on fatal error.
  */
-#if __linux__
+#if WITH_MACVTAP
 int
 ifaceMacvtapLinkAdd(const char *type,
                     const unsigned char *macaddress, int macaddrsize,
@@ -758,7 +758,7 @@ ifaceLinkDel(const char *ifname ATTRIBUTE_UNUSED)
 #endif
 
 
-#if __linux__
+#if WITH_MACVTAP
 static struct nla_policy ifla_policy[IFLA_MAX + 1] =
 {
   [IFLA_VF_PORTS] = { .type = NLA_NESTED },
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]