[libvirt] [PATCHv2 0/5] build: update gnulib

This replaces the first cut at this series: https://www.redhat.com/archives/libvir-list/2010-April/msg01341.html Changes since v1: squash the original 1/5 and 2/5 into one patch test every stage of the series on a cross-compile to mingw add new 5/5, and adjust to recent syntax checks available in today's gnulib [PATCHv2 1/5] build: rely on gnulib's pthread module [PATCHv2 2/5] build: use gnulib's uname [PATCHv2 3/5] build: use gnulib's sys/wait.h [PATCHv2 4/5] build: drop more redundant configure checks [PATCHv2 5/5] build: update gnulib Because of the new patch, I'll wait for a re-ACK before pushing; but 1 through 4 are pretty much unchanged from their original ACK. .gnulib | 2 +- .x-sc_prohibit_always_true_header_tests | 4 ++++ bootstrap.conf | 3 +++ configure.ac | 22 ++++------------------ src/libvirt.c | 4 +--- src/network/bridge_driver.c | 1 - src/nodeinfo.c | 12 ++---------- src/openvz/openvz_conf.c | 2 +- src/openvz/openvz_driver.c | 2 +- src/phyp/phyp_driver.c | 1 - src/qemu/qemu_driver.c | 1 - src/remote/remote_driver.c | 5 +---- src/storage/storage_backend.c | 4 +--- src/uml/uml_driver.c | 1 - src/util/ebtables.c | 7 ++----- src/util/hooks.c | 4 +--- src/util/iptables.c | 7 ++----- src/util/processinfo.c | 6 ++---- src/util/util.c | 4 +--- 19 files changed, 27 insertions(+), 65 deletions(-)

Gnulib can guarantee that pthread.h exists, but for now, it is a dummy header with no support for most pthread_* functions. Modify our use of pthread to use function checks, rather than header checks, to determine how much pthread support is present. * bootstrap.conf (gnulib_modules): Add pthread. * configure.ac: Drop all pthread.h checks. Optimize function checks. Add check for pthread functions. * src/Makefile.am (libvirt_lxc_LDADD): Ensure proper link. * src/remote/remote_driver.c (remoteIOEventLoop): Depend on pthread_sigmask, now that gnulib guarantees pthread.h. * src/util/util.c (virFork): Likewise. * src/util/threads.c (threads-pthread.c): Depend on pthread_mutexattr_init, as a witness of full pthread support. * src/util/threads.h (threads-pthread.h): Likewise. --- bootstrap.conf | 1 + configure.ac | 21 +++++++++++---------- src/Makefile.am | 3 ++- src/remote/remote_driver.c | 6 +++--- src/util/threads.c | 4 ++-- src/util/threads.h | 4 ++-- src/util/util.c | 10 +++++----- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 785489b..da7cc9c 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -43,6 +43,7 @@ perror physmem poll posix-shell +pthread recv random_r send diff --git a/configure.ac b/configure.ac index 5d68dcc..93eb654 100644 --- a/configure.ac +++ b/configure.ac @@ -106,10 +106,19 @@ dnl Use --disable-largefile if you don't want this. AC_SYS_LARGEFILE dnl Availability of various common functions (non-fatal if missing). -AC_CHECK_FUNCS([cfmakeraw regexec uname sched_getaffinity getuid getgid posix_fallocate mmap]) +AC_CHECK_FUNCS_ONCE([cfmakeraw regexec uname sched_getaffinity getuid getgid \ + posix_fallocate mmap]) dnl Availability of various not common threadsafe functions -AC_CHECK_FUNCS([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r]) +AC_CHECK_FUNCS_ONCE([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r]) + +dnl Availability of pthread functions (if missing, win32 threading is +dnl assumed). Because of $LIB_PTHREAD, we cannot use AC_CHECK_FUNCS_ONCE. +dnl LIB_PTHREAD was set during gl_INIT by gnulib. +old_LIBS=$LIBS +LIBS="$LIBS $LIB_PTHREAD" +AC_CHECK_FUNCS([pthread_sigmask pthread_mutexattr_init]) +LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h \ @@ -137,14 +146,6 @@ AM_CONDITIONAL([HAVE_GLIBC_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno" && $ac_cv_path_RPCGEN -t </dev/null >/dev/null 2>&1]) -dnl pthread? -AC_CHECK_HEADER([pthread.h], - [AC_CHECK_LIB([pthread],[pthread_join],[ - AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)]) - AC_DEFINE([HAVE_PTHREAD_H],[],[Define if <pthread.h>]) - LIBS="-lpthread $LIBS" - ])]) - dnl Miscellaneous external programs. AC_PATH_PROG([RM], [rm], [/bin/rm]) AC_PATH_PROG([MV], [mv], [/bin/mv]) diff --git a/src/Makefile.am b/src/Makefile.am index 2531ac5..dc76d03 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -984,7 +984,8 @@ libvirt_lxc_SOURCES = \ $(CPU_CONF_SOURCES) \ $(NWFILTER_PARAM_CONF_SOURCES) libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS) $(CAPNG_LIBS) $(YAJL_LIBS) -libvirt_lxc_LDADD = $(LIBXML_LIBS) $(NUMACTL_LIBS) ../gnulib/lib/libgnu.la +libvirt_lxc_LDADD = $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ + ../gnulib/lib/libgnu.la libvirt_lxc_CFLAGS = \ $(LIBPARTED_CFLAGS) \ $(NUMACTL_CFLAGS) \ diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 317125f..bf53da4 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -9556,7 +9556,7 @@ remoteIOEventLoop(virConnectPtr conn, struct remote_thread_call *tmp = priv->waitDispatch; struct remote_thread_call *prev; char ignore; -#ifdef HAVE_PTHREAD_H +#ifdef HAVE_PTHREAD_SIGMASK sigset_t oldmask, blockedsigs; #endif @@ -9585,7 +9585,7 @@ remoteIOEventLoop(virConnectPtr conn, * after the call (RHBZ#567931). Same for SIGCHLD and SIGPIPE * at the suggestion of Paolo Bonzini and Daniel Berrange. */ -#ifdef HAVE_PTHREAD_H +#ifdef HAVE_PTHREAD_SIGMASK sigemptyset (&blockedsigs); sigaddset (&blockedsigs, SIGWINCH); sigaddset (&blockedsigs, SIGCHLD); @@ -9598,7 +9598,7 @@ remoteIOEventLoop(virConnectPtr conn, if (ret < 0 && errno == EAGAIN) goto repoll; -#ifdef HAVE_PTHREAD_H +#ifdef HAVE_PTHREAD_SIGMASK ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); #endif diff --git a/src/util/threads.c b/src/util/threads.c index 18f8b64..8c0a91a 100644 --- a/src/util/threads.c +++ b/src/util/threads.c @@ -1,7 +1,7 @@ /* * threads.c: basic thread synchronization primitives * - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,7 @@ #include "threads.h" -#ifdef HAVE_PTHREAD_H +#ifdef HAVE_PTHREAD_MUTEXATTR_INIT # include "threads-pthread.c" #else # ifdef WIN32 diff --git a/src/util/threads.h b/src/util/threads.h index 6e01082..8b2be8d 100644 --- a/src/util/threads.h +++ b/src/util/threads.h @@ -1,7 +1,7 @@ /* * threads.h: basic thread synchronization primitives * - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -61,7 +61,7 @@ int virThreadLocalInit(virThreadLocalPtr l, void *virThreadLocalGet(virThreadLocalPtr l); void virThreadLocalSet(virThreadLocalPtr l, void*); -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_MUTEXATTR_INIT # include "threads-pthread.h" # else # ifdef WIN32 diff --git a/src/util/util.c b/src/util/util.c index 2d32952..848f300 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -316,7 +316,7 @@ static int virClearCapabilities(void) */ int virFork(pid_t *pid) { -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_SIGMASK sigset_t oldmask, newmask; # endif struct sigaction sig_action; @@ -328,7 +328,7 @@ int virFork(pid_t *pid) { * Need to block signals now, so that child process can safely * kill off caller's signal handlers without a race. */ -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_SIGMASK sigfillset(&newmask); if (pthread_sigmask(SIG_SETMASK, &newmask, &oldmask) != 0) { saved_errno = errno; @@ -349,7 +349,7 @@ int virFork(pid_t *pid) { virLogUnlock(); if (*pid < 0) { -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_SIGMASK /* attempt to restore signal mask, but ignore failure, to avoid obscuring the fork failure */ ignore_value (pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); @@ -363,7 +363,7 @@ int virFork(pid_t *pid) { /* parent process */ -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_SIGMASK /* Restore our original signal mask now that the child is safely running */ if (pthread_sigmask(SIG_SETMASK, &oldmask, NULL) != 0) { @@ -407,7 +407,7 @@ int virFork(pid_t *pid) { sigaction(i, &sig_action, NULL); } -# ifdef HAVE_PTHREAD_H +# ifdef HAVE_PTHREAD_SIGMASK /* Unmask all signals in child, since we've no idea what the caller's done with their signal mask and don't want to propagate that to children */ -- 1.6.6.1

* bootstrap.conf (gnulib_modules): Add uname. * configure.ac: Drop uname and sys/utsname.h checks. * src/nodeinfo.c (nodeGetInfo): Use uname unconditionally. --- bootstrap.conf | 1 + configure.ac | 4 ++-- src/nodeinfo.c | 12 ++---------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index da7cc9c..e85f869 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -59,6 +59,7 @@ strtok_r sys_stat time_r timegm +uname useless-if-before-free usleep vasprintf diff --git a/configure.ac b/configure.ac index 93eb654..18da606 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,7 @@ dnl Use --disable-largefile if you don't want this. AC_SYS_LARGEFILE dnl Availability of various common functions (non-fatal if missing). -AC_CHECK_FUNCS_ONCE([cfmakeraw regexec uname sched_getaffinity getuid getgid \ +AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \ posix_fallocate mmap]) dnl Availability of various not common threadsafe functions @@ -121,7 +121,7 @@ AC_CHECK_FUNCS([pthread_sigmask pthread_mutexattr_init]) LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h \ +AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h \ sys/wait.h sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h]) dnl Where are the XDR functions? diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 4d7fac1..5ec1bcf 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -29,16 +29,13 @@ #include <stdint.h> #include <errno.h> #include <dirent.h> +#include <sys/utsname.h> #if HAVE_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 # include <numa.h> #endif -#ifdef HAVE_SYS_UTSNAME_H -# include <sys/utsname.h> -#endif - #include "c-ctype.h" #include "memory.h" #include "nodeinfo.h" @@ -273,18 +270,13 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, #endif int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) { - memset(nodeinfo, 0, sizeof(*nodeinfo)); - -#ifdef HAVE_UNAME - { struct utsname info; + memset(nodeinfo, 0, sizeof(*nodeinfo)); uname(&info); if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL) return -1; - } -#endif /* !HAVE_UNAME */ #ifdef __linux__ { -- 1.6.6.1

* configure.ac: Drop sys/wait.h check. * src/libvirt.c (includes): Use header unconditionally. * src/remote/remote_driver.c (includes): Likewise. * src/storage/storage_backend.c (includes): Likewise. * src/util/ebtables.c (includes): Likewise. * src/util/hooks.c (includes): Likewise. * src/util/iptables.c (includes): Likewise. * src/util/util.c (includes): Likewise. --- bootstrap.conf | 1 + configure.ac | 2 +- src/libvirt.c | 4 +--- src/remote/remote_driver.c | 5 +---- src/storage/storage_backend.c | 4 +--- src/util/ebtables.c | 7 ++----- src/util/hooks.c | 4 +--- src/util/iptables.c | 7 ++----- src/util/util.c | 4 +--- 9 files changed, 11 insertions(+), 27 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index e85f869..baf0bc2 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -57,6 +57,7 @@ strptime strsep strtok_r sys_stat +sys_wait time_r timegm uname diff --git a/configure.ac b/configure.ac index 18da606..12646e0 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,7 @@ LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h \ - sys/wait.h sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h]) + sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h]) dnl Where are the XDR functions? dnl If portablexdr is installed, prefer that. diff --git a/src/libvirt.c b/src/libvirt.c index 028115c..eb05337 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -18,9 +18,7 @@ #include <sys/stat.h> #include <unistd.h> #include <assert.h> -#ifdef HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #include <time.h> #include <gcrypt.h> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index bf53da4..72cf292 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -33,6 +33,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <arpa/inet.h> +#include <sys/wait.h> /* Windows socket compatibility functions. */ #include <errno.h> @@ -45,10 +46,6 @@ # include <netinet/tcp.h> #endif -#ifdef HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif - #ifdef HAVE_PWD_H # include <pwd.h> #endif diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index be87a81..7df61cd 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -29,9 +29,7 @@ # include <regex.h> #endif #include <sys/types.h> -#if HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #include <unistd.h> #include <fcntl.h> #include <stdint.h> diff --git a/src/util/ebtables.c b/src/util/ebtables.c index a6afdf8..e2b9608 100644 --- a/src/util/ebtables.c +++ b/src/util/ebtables.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2009 IBM Corp. * Copyright (C) 2007-2010 Red Hat, Inc. + * Copyright (C) 2009 IBM Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,10 +33,7 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> - -#ifdef HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #ifdef HAVE_PATHS_H # include <paths.h> diff --git a/src/util/hooks.c b/src/util/hooks.c index 507029f..dec9223 100644 --- a/src/util/hooks.c +++ b/src/util/hooks.c @@ -24,9 +24,7 @@ #include <config.h> #include <sys/types.h> -#if HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> diff --git a/src/util/iptables.c b/src/util/iptables.c index facc4da..4f95a02 100644 --- a/src/util/iptables.c +++ b/src/util/iptables.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 Red Hat, Inc. + * Copyright (C) 2007-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,10 +31,7 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> - -#ifdef HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #ifdef HAVE_PATHS_H # include <paths.h> diff --git a/src/util/util.c b/src/util/util.c index 848f300..f097b2f 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -37,9 +37,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> -#if HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include <sys/wait.h> #if HAVE_MMAP # include <sys/mman.h> #endif -- 1.6.6.1

* configure.ac (AC_CHECK_FUNCS_ONCE, AC_SYS_LARGEFILE): Rely on gnulib for strtok_r and large file support. (AC_OBJEXT): Drop call now done by AC_PROG_CC. (m4_foreach_w): Drop macro guaranteed by gnulib. (AC_C_CONST): Drop call declared obsolete by autoconf. Signed-off-by: Eric Blake <eblake@redhat.com> --- configure.ac | 16 +--------------- 1 files changed, 1 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 12646e0..c643c56 100644 --- a/configure.ac +++ b/configure.ac @@ -48,20 +48,10 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP -AC_OBJEXT - -dnl gl_INIT uses m4_foreach_w, yet that is not defined in autoconf-2.59. -dnl In order to accommodate developers with such old tools, here's a -dnl replacement definition. -m4_ifndef([m4_foreach_w], - [m4_define([m4_foreach_w], - [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) - gl_EARLY gl_INIT AM_PROG_CC_STDC -AC_C_CONST AC_TYPE_UID_T dnl Make sure we have an ANSI compiler @@ -101,16 +91,12 @@ fi AC_MSG_RESULT([$have_cpuid]) -dnl Support large files / 64 bit seek offsets. -dnl Use --disable-largefile if you don't want this. -AC_SYS_LARGEFILE - dnl Availability of various common functions (non-fatal if missing). AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \ posix_fallocate mmap]) dnl Availability of various not common threadsafe functions -AC_CHECK_FUNCS_ONCE([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r]) +AC_CHECK_FUNCS_ONCE([strerror_r getmntent_r getgrnam_r getpwuid_r]) dnl Availability of pthread functions (if missing, win32 threading is dnl assumed). Because of $LIB_PTHREAD, we cannot use AC_CHECK_FUNCS_ONCE. -- 1.6.6.1

81 patches to gnulib, picks up several new syntax checks. * .gnulib: Update to latest. * .x-sc_prohibit_always_true_header_tests: New file. * bootstrap.conf (gnulib_modules): Add sched. * src/util/processinfo.c (includes): <sched.h> is now guaranteed. * src/network/bridge_driver.c (includes): Drop useless <strings.h>. * src/openvz/openvz_conf.c (includes): Likewise. * src/openvz/openvz_driver.c (includes): Likewise. * src/phyp/phyp_driver.c (includes): Likewise. * src/qemu/qemu_driver.c (includes): Likewise. * src/uml/uml_driver.c (includes): Likewise. --- .gnulib | 2 +- .x-sc_prohibit_always_true_header_tests | 4 ++++ bootstrap.conf | 1 + src/network/bridge_driver.c | 1 - src/openvz/openvz_conf.c | 2 +- src/openvz/openvz_driver.c | 2 +- src/phyp/phyp_driver.c | 1 - src/qemu/qemu_driver.c | 1 - src/uml/uml_driver.c | 1 - src/util/processinfo.c | 6 ++---- 10 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 .x-sc_prohibit_always_true_header_tests diff --git a/.gnulib b/.gnulib index 7c1b995..e2843e3 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 7c1b995a7041ea366acafeb8632e1080f349f03f +Subproject commit e2843e30e8c2885eb8cbc77e20c4e0f4d562d44d diff --git a/.x-sc_prohibit_always_true_header_tests b/.x-sc_prohibit_always_true_header_tests new file mode 100644 index 0000000..ff753ce --- /dev/null +++ b/.x-sc_prohibit_always_true_header_tests @@ -0,0 +1,4 @@ +ChangeLog* +docs/news.html.in +python/libvirt-override.c +python/typewrappers.c diff --git a/bootstrap.conf b/bootstrap.conf index baf0bc2..1e93490 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -46,6 +46,7 @@ posix-shell pthread recv random_r +sched send setsockopt socket diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 132392b..8432bbc 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -29,7 +29,6 @@ #include <limits.h> #include <string.h> #include <stdio.h> -#include <strings.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 8735cc1..b52f4ac 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -1,6 +1,7 @@ /* * openvz_conf.c: config functions for managing OpenVZ VEs * + * Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2006, 2007 Binary Karma * Copyright (C) 2006 Shuveb Hussain * Copyright (C) 2007 Anoop Joe Cyriac @@ -33,7 +34,6 @@ #include <fcntl.h> #include <sys/types.h> #include <dirent.h> -#include <strings.h> #include <time.h> #include <sys/stat.h> #include <unistd.h> diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 00b8a14..ce159d0 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1,6 +1,7 @@ /* * openvz_driver.c: core driver methods for managing OpenVZ VEs * + * Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2006, 2007 Binary Karma * Copyright (C) 2006 Shuveb Hussain * Copyright (C) 2007 Anoop Joe Cyriac @@ -33,7 +34,6 @@ #include <limits.h> #include <string.h> #include <stdio.h> -#include <strings.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 467ea19..cec99b1 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -29,7 +29,6 @@ #include <sys/stat.h> #include <limits.h> #include <string.h> -#include <strings.h> #include <stdio.h> #include <stdarg.h> #include <stdlib.h> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 704f824..752551b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -31,7 +31,6 @@ #include <string.h> #include <stdbool.h> #include <stdio.h> -#include <strings.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 644ac8b..63fe808 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -29,7 +29,6 @@ #include <limits.h> #include <string.h> #include <stdio.h> -#include <strings.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/util/processinfo.c b/src/util/processinfo.c index ed2130a..b1b1737 100644 --- a/src/util/processinfo.c +++ b/src/util/processinfo.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,9 +21,7 @@ #include <config.h> -#if HAVE_SCHED_H -# include <sched.h> -#endif +#include <sched.h> #include "processinfo.h" #include "virterror_internal.h" -- 1.6.6.1

* configure.ac: Remove redundant checks. --- Noticed this simplification after sending my series. configure.ac | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 deletions(-) diff --git a/configure.ac b/configure.ac index c643c56..c187420 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,7 @@ LIBS=$old_libs dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h \ - sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h]) + termios.h sys/poll.h syslog.h mntent.h net/ethernet.h]) dnl Where are the XDR functions? dnl If portablexdr is installed, prefer that. @@ -495,33 +495,19 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_CHECK_HEADER([sched.h], - dnl Header is there, check for unshare() - [ - AC_TRY_LINK([#define _GNU_SOURCE - #include <sched.h>], [ - unshare (1); - ], [ - with_lxc=yes - ], [ - if test "$with_lxc" = "check"; then - with_lxc=no - AC_MSG_NOTICE([Function unshare() not present in <sched.h> header but required for LXC driver, disabling it]) - else - AC_MSG_ERROR([Function unshare() not present in <sched.h> header, but required for LXC driver]) - fi - - ]) - - dnl Header is not there - ],[ + AC_TRY_LINK([#define _GNU_SOURCE + #include <sched.h> + ], [ + unshare (1); + ], [ + with_lxc=yes + ], [ if test "$with_lxc" = "check"; then with_lxc=no - AC_MSG_NOTICE([Header <sched.h> not found but required for LXC driver, disabling it]) + AC_MSG_NOTICE([Function unshare() not present in <sched.h> header but required for LXC driver, disabling it]) else - AC_MSG_ERROR([Header <sched.h> not found but required for LXC driver]) + AC_MSG_ERROR([Function unshare() not present in <sched.h> header, but required for LXC driver]) fi - ]) fi if test "$with_lxc" = "yes" ; then -- 1.6.6.1

Eric Blake wrote:
* configure.ac: Remove redundant checks.
Noticed this simplification after sending my series.
configure.ac | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 deletions(-)
Nice. ACK.

On 05/04/2010 03:16 PM, Eric Blake wrote:
This replaces the first cut at this series: https://www.redhat.com/archives/libvir-list/2010-April/msg01341.html
Changes since v1: squash the original 1/5 and 2/5 into one patch test every stage of the series on a cross-compile to mingw add new 5/5, and adjust to recent syntax checks available in today's gnulib
[PATCHv2 1/5] build: rely on gnulib's pthread module [PATCHv2 2/5] build: use gnulib's uname [PATCHv2 3/5] build: use gnulib's sys/wait.h [PATCHv2 4/5] build: drop more redundant configure checks [PATCHv2 5/5] build: update gnulib
Because of the new patch, I'll wait for a re-ACK before pushing; but 1 through 4 are pretty much unchanged from their original ACK.
To make it easier, here's the interdiff between my original series and this v2 series: -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 05/04/2010 03:16 PM, Eric Blake wrote:
This replaces the first cut at this series: https://www.redhat.com/archives/libvir-list/2010-April/msg01341.html
Changes since v1: squash the original 1/5 and 2/5 into one patch test every stage of the series on a cross-compile to mingw add new 5/5, and adjust to recent syntax checks available in today's gnulib
[PATCHv2 1/5] build: rely on gnulib's pthread module [PATCHv2 2/5] build: use gnulib's uname [PATCHv2 3/5] build: use gnulib's sys/wait.h [PATCHv2 4/5] build: drop more redundant configure checks [PATCHv2 5/5] build: update gnulib
Because of the new patch, I'll wait for a re-ACK before pushing; but 1 through 4 are pretty much unchanged from their original ACK.
To make it easier, here's the interdiff between my original series and this v2 series:
Thanks for taking the time. That does indeed help. ACK.

On 05/06/2010 09:28 AM, Jim Meyering wrote:
Because of the new patch, I'll wait for a re-ACK before pushing; but 1 through 4 are pretty much unchanged from their original ACK.
To make it easier, here's the interdiff between my original series and this v2 series:
Thanks for taking the time. That does indeed help.
ACK.
Thanks for the review, and for teaching me some patience while waiting for it :) Now pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Jim Meyering