[PATCH 5/7] Fix conditional build of virNetDevSetupControlFull

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The virNetDevSetupControlFull function was protected by a
Update the conditionals around all callers to do stricter
checks to ensure we always build

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/virnetdevbridge.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 3c00be9..9d46cc4 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -46,7 +46,7 @@
 #define VIR_FROM_THIS VIR_FROM_NONE
 
 
-#ifdef SIOCBRADDBR
+#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
 static int virNetDevSetupControlFull(const char *ifname,
                                      struct ifreq *ifr,
                                      int domain,
@@ -89,7 +89,7 @@ static int virNetDevSetupControl(const char *ifname,
 }
 #endif
 
-#ifdef __linux__
+#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
 # define SYSFS_NET_DIR "/sys/class/net"
 /*
  * Bridge parameters can be set via sysfs on newish kernels,
@@ -211,7 +211,7 @@ cleanup:
  *
  * Returns 0 in case of success or -1 on failure
  */
-#ifdef SIOCBRADDBR
+#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR)
 int virNetDevBridgeCreate(const char *brname)
 {
     int fd = -1;
@@ -249,7 +249,7 @@ int virNetDevBridgeCreate(const char *brname)
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#ifdef SIOCBRDELBR
+#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR)
 int virNetDevBridgeDelete(const char *brname)
 {
     int fd = -1;
@@ -288,7 +288,7 @@ int virNetDevBridgeDelete(const char *brname ATTRIBUTE_UNUSED)
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#ifdef SIOCBRADDIF
+#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDIF)
 int virNetDevBridgeAddPort(const char *brname,
                            const char *ifname)
 {
@@ -335,7 +335,7 @@ int virNetDevBridgeAddPort(const char *brname,
  *
  * Returns 0 in case of success or an errno code in case of failure.
  */
-#ifdef SIOCBRDELIF
+#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELIF)
 int virNetDevBridgeRemovePort(const char *brname,
                               const char *ifname)
 {
@@ -375,7 +375,7 @@ int virNetDevBridgeRemovePort(const char *brname,
 #endif
 
 
-#ifdef __linux__
+#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
 /**
  * virNetDevBridgeSetSTPDelay:
  * @brname: the bridge name
-- 
1.8.1.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]