1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

Fix conditional build of virNetDevSetupControlFull

The virNetDevSetupControlFull function was protected by a
conditional on SIOCBRADDBR, which is bogus since it does
not use that symbol. Update the conditionals around all
callers to do stricter checks to ensure we always build
succesfully

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-03-07 16:36:57 +00:00
parent 3ed2e54500
commit 495e3b2b50

View File

@ -46,7 +46,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE
#ifdef SIOCBRADDBR #if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
static int virNetDevSetupControlFull(const char *ifname, static int virNetDevSetupControlFull(const char *ifname,
struct ifreq *ifr, struct ifreq *ifr,
int domain, int domain,
@ -89,7 +89,7 @@ static int virNetDevSetupControl(const char *ifname,
} }
#endif #endif
#ifdef __linux__ #if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
# define SYSFS_NET_DIR "/sys/class/net" # define SYSFS_NET_DIR "/sys/class/net"
/* /*
* Bridge parameters can be set via sysfs on newish kernels, * 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 * 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 virNetDevBridgeCreate(const char *brname)
{ {
int fd = -1; 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. * 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 virNetDevBridgeDelete(const char *brname)
{ {
int fd = -1; 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. * 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, int virNetDevBridgeAddPort(const char *brname,
const char *ifname) 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. * 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, int virNetDevBridgeRemovePort(const char *brname,
const char *ifname) const char *ifname)
{ {
@ -375,7 +375,7 @@ int virNetDevBridgeRemovePort(const char *brname,
#endif #endif
#ifdef __linux__ #if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
/** /**
* virNetDevBridgeSetSTPDelay: * virNetDevBridgeSetSTPDelay:
* @brname: the bridge name * @brname: the bridge name