[libvirt] Fix -Werror build error regarding to '#ifdef IFF_VNET_HDR'

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

 



Hi!

Our build bot found a build error when building libVirt with -Werror
introduced in
  b4f62abbf1191c8fbab3306b4bf2f2567e18067f
  kvm/virtio: Set IFF_VNET_HDR when setting up tap fds

The attached patch kind of fixes the build error but I'm not sure, if
this is the final solution for this problem, though...

Ciao
Max
-- 
The real problem with C++ for kernel modules is:
the language just sucks.
-- Linus Torvalds
diff --git a/src/bridge.c b/src/bridge.c
index 58e480e..414d87b 100644
--- a/src/bridge.c
+++ b/src/bridge.c
@@ -401,6 +401,7 @@ static int brSetInterfaceMtu(brControl *ctl,
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
+#ifdef IFF_VNET_HDR
 static int
 brProbeVnetHdr(int tapfd)
 {
@@ -438,6 +439,7 @@ brProbeVnetHdr(int tapfd)
     return 0;
 #endif
 }
+#endif
 
 /**
  * brAddTap:
@@ -480,6 +482,8 @@ brAddTap(brControl *ctl,
 #ifdef IFF_VNET_HDR
     if (vnet_hdr && brProbeVnetHdr(fd))
         ifr.ifr_flags |= IFF_VNET_HDR;
+#else
+    (void) vnet_hdr;
 #endif
 
     strncpy(ifr.ifr_name, *ifname, IFNAMSIZ-1);
--
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]