diff --git a/.gnulib b/.gnulib index 271dd74fdf54ec2a03e73a5173b0b5697f6088f1..440a1dbe523e37f206252cb034c3a62f26867e42 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 271dd74fdf54ec2a03e73a5173b0b5697f6088f1 +Subproject commit 440a1dbe523e37f206252cb034c3a62f26867e42 diff --git a/bootstrap.conf b/bootstrap.conf index 7fefb69f43b210a431e183b5f404af3644e085b8..2847c0bfd37303318146ad03a0b4555fd3f4020f 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -38,6 +38,7 @@ count-one-bits crypto/md5 dirname-lgpl environ +execinfo fclose fcntl fcntl-h @@ -70,6 +71,7 @@ manywarnings mkstemp mkstemps mktempd +net_if netdb nonblocking openpty diff --git a/configure.ac b/configure.ac index cb91e7d7294c69ed9d06dc901c63cd5eece614c9..47a72b9b74a42fdc9638fbdca55c50e4ee6842cd 100644 --- a/configure.ac +++ b/configure.ac @@ -186,8 +186,7 @@ LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \ sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \ - sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h \ - net/if.h execinfo.h]) + sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h]) dnl We need to decide at configure time if libvirt will use real atomic dnl operations ("lock free") or emulated ones with a mutex. @@ -245,20 +244,12 @@ AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"]) AC_MSG_RESULT([$atomic_ops]) - -AC_MSG_CHECKING([for struct ifreq in net/if.h]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[ - #include - ]], - [[ - struct ifreq ifr; - ]])],[ - AC_DEFINE([HAVE_STRUCT_IFREQ],[],[Defined if struct ifreq existsin net/if.h]) - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([yes]) - ]) +AC_CHECK_TYPE([struct ifreq], + [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], + [Defined if struct ifreq exists in net/if.h])], + [], [[#include + #include + ]]) dnl Our only use of libtasn1.h is in the testsuite, and can be skipped dnl if the header is not present. Assume -ltasn1 is present if the diff --git a/src/internal.h b/src/internal.h index 02fdb8d25b23e827b3273cf61340fbeaf4519a55..8037a4ae847ef4e4b3a750aee81dfe8f443b7a45 100644 --- a/src/internal.h +++ b/src/internal.h @@ -58,10 +58,6 @@ # define HOST_NAME_MAX 256 # endif -# ifndef IF_NAMESIZE -# define IF_NAMESIZE 16 -# endif - # ifndef INET_ADDRSTRLEN # define INET_ADDRSTRLEN 16 # endif diff --git a/src/nwfilter/nwfilter_learnipaddr.h b/src/nwfilter/nwfilter_learnipaddr.h index 977b16d3a53313c5d745901c4a0e11eeb51c7fbc..f2ac85eeacc08c112c5d8cc8ac88557100f8f9c5 100644 --- a/src/nwfilter/nwfilter_learnipaddr.h +++ b/src/nwfilter/nwfilter_learnipaddr.h @@ -2,6 +2,7 @@ * nwfilter_learnipaddr.h: support for learning IP address used by a VM * on an interface * + * Copyright (C) 2012 Red Hat, Inc. * Copyright (C) 2010 IBM Corp. * Copyright (C) 2010 Stefan Berger * @@ -26,6 +27,7 @@ # define __NWFILTER_LEARNIPADDR_H # include "conf/nwfilter_params.h" +# include enum howDetect { DETECT_DHCP = 1, diff --git a/src/util/logging.c b/src/util/logging.c index a7f6b653ae3bea285f01406aba13cebe277071f2..6048151e7dd46b6bd7be4deb0ac364a02cf23796 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -31,12 +31,10 @@ #include #include #include +#include #if HAVE_SYSLOG_H # include #endif -#ifdef HAVE_EXECINFO_H -# include -#endif #include "virterror_internal.h" #include "logging.h" @@ -792,23 +790,21 @@ cleanup: static void virLogStackTraceToFd(int fd) { -#ifdef HAVE_EXECINFO_H void *array[100]; int size; - -# define STRIP_DEPTH 3 - - size = backtrace(array, ARRAY_CARDINALITY(array)); - backtrace_symbols_fd(array + STRIP_DEPTH, size - STRIP_DEPTH, fd); - ignore_value(safewrite(fd, "\n", 1)); -#else static bool doneWarning = false; const char *msg = "Stack trace not available on this platform\n"; - if (!doneWarning) { + +#define STRIP_DEPTH 3 + size = backtrace(array, ARRAY_CARDINALITY(array)); + if (size) { + backtrace_symbols_fd(array + STRIP_DEPTH, size - STRIP_DEPTH, fd); + ignore_value(safewrite(fd, "\n", 1)); + } else if (!doneWarning) { ignore_value(safewrite(fd, msg, strlen(msg))); doneWarning = true; } -#endif +#undef STRIP_DEPTH } static int virLogOutputToFd(const char *category ATTRIBUTE_UNUSED, diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index d97820e1c63eda87402f0a504e346a8e710aad5e..f622f5df19d1032a88e178d75c2127e86f55bf7b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -32,9 +32,7 @@ #include "logging.h" #include -#ifdef HAVE_NET_IF_H -# include -#endif +#include #include #ifdef __linux__ diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index a29e4b2d034d9b39e25d23c11d1648763ef734f1..4efb98ddb1f630d552e09fd48c4aed157e8641db 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -31,10 +31,8 @@ #include #include +#include -#ifdef HAVE_NET_IF_H -# include -#endif #ifdef __linux__ # include # include /* HZ */ @@ -47,7 +45,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE -#if defined(HAVE_NET_IF_H) && defined(SIOCBRADDBR) +#ifdef SIOCBRADDBR static int virNetDevSetupControlFull(const char *ifname, struct ifreq *ifr, int domain, diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 24f30b506362c47ce42ae8cace47bd1f5275c7db..37e91d0c0746916392e7cabe6c5b3ea286cac3de 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -35,9 +35,7 @@ #include "util.h" #include -#ifdef HAVE_NET_IF_H -# include -#endif +#include #include #ifdef __linux__ # include /* IFF_TUN, IFF_NO_PI */