[libvirt] [PATCH 00/28] Convert more of configure.ac to use helper macros

This is a follow-on series from https://www.redhat.com/archives/libvir-list/2013-January/msg00647.html It converts all the remaining easy library/package checks to use the new helper macros. What's let are some tricky cases where we first check via pkg-config and then fallback to a manual check, or cases where we use a custom pkg-config like program

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/lxc/lxc_container.c | 2 +- src/storage/storage_backend.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f2b59ef..b50e329 100644 --- a/configure.ac +++ b/configure.ac @@ -1291,12 +1291,12 @@ if test "$with_selinux" = "yes"; then SELINUX_LIBS="-lselinux" AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point]) - AC_DEFINE_UNQUOTED([HAVE_SELINUX], 1, [whether basic SELinux functionality is available]) + AC_DEFINE_UNQUOTED([WITH_SELINUX], 1, [whether basic SELinux functionality is available]) dnl We prefer to use <selinux/label.h> and selabel_open, but can fall dnl back to matchpathcon for the sake of RHEL 5's version of libselinux. AC_CHECK_HEADERS([selinux/label.h]) fi -AM_CONDITIONAL([HAVE_SELINUX], [test "$with_selinux" != "no"]) +AM_CONDITIONAL([WITH_SELINUX], [test "$with_selinux" != "no"]) AC_SUBST([SELINUX_CFLAGS]) AC_SUBST([SELINUX_LIBS]) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 9f22923..ee1d676 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -524,7 +524,7 @@ static int lxcContainerMountBasicFS(bool pivotRoot, { "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, { "sysfs", "/sys", "sysfs", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, -#if HAVE_SELINUX +#if WITH_SELINUX { SELINUX_MOUNT, SELINUX_MOUNT, "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, { SELINUX_MOUNT, SELINUX_MOUNT, NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, #endif diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index df79b28..c2c4c51 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -41,7 +41,7 @@ # include <linux/fs.h> #endif -#if HAVE_SELINUX +#if WITH_SELINUX # include <selinux/selinux.h> #endif @@ -1177,7 +1177,7 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageVolTargetPtr target, unsigned long long *capacity) { struct stat sb; -#if HAVE_SELINUX +#if WITH_SELINUX security_context_t filecon = NULL; #endif @@ -1241,7 +1241,7 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageVolTargetPtr target, VIR_FREE(target->perms.label); -#if HAVE_SELINUX +#if WITH_SELINUX /* XXX: make this a security driver call */ if (fgetfilecon_raw(fd, &filecon) == -1) { if (errno != ENODATA && errno != ENOTSUP) { -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/lxc/lxc_container.c | 2 +- src/storage/storage_backend.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 62 ++---------------------------------------------------- m4/virt-selinux.m4 | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 60 deletions(-) create mode 100644 m4/virt-selinux.m4 diff --git a/configure.ac b/configure.ac index b50e329..79cd132 100644 --- a/configure.ac +++ b/configure.ac @@ -158,6 +158,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL +LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_YAJL AC_MSG_CHECKING([for CPUID instruction]) @@ -1246,61 +1247,6 @@ fi AM_CONDITIONAL([VIR_CHRDEV_LOCK_FILE_PATH], [test "$with_chrdev_lock_files" != "no"]) -dnl SELinux -AC_ARG_WITH([selinux], - AC_HELP_STRING([--with-selinux], [use SELinux to manage security @<:@default=check@:>@]), - [], - [with_selinux=check]) -AC_ARG_WITH([selinux_mount], - AC_HELP_STRING([--with-selinux-mount], [set SELinux mount point @<:@default=check@:>@]), - [], - [with_selinux_mount=check]) - -SELINUX_CFLAGS= -SELINUX_LIBS= -if test "$with_selinux" != "no"; then - old_cflags="$CFLAGS" - old_libs="$LIBS" - if test "$with_selinux" = "check"; then - AC_CHECK_HEADER([selinux/selinux.h],[],[with_selinux=no]) - AC_CHECK_LIB([selinux], [fgetfilecon_raw],[],[with_selinux=no]) - if test "$with_selinux" != "no"; then - with_selinux="yes" - fi - else - fail=0 - AC_CHECK_HEADER([selinux/selinux.h],[],[fail=1]) - AC_CHECK_LIB([selinux], [fgetfilecon_raw],[],[fail=1]) - test $fail = 1 && - AC_MSG_ERROR([You must install the libselinux development package in order to compile libvirt with basic SELinux support]) - fi - CFLAGS="$old_cflags" - LIBS="$old_libs" -fi -if test "$with_selinux" = "yes"; then - AC_MSG_CHECKING([SELinux mount point]) - if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then - SELINUX_MOUNT=/sys/fs/selinux - if ! test -d ${SELINUX_MOUNT} && test -d /selinux ; then - SELINUX_MOUNT=/selinux - fi - else - SELINUX_MOUNT=$with_selinux_mount - fi - AC_MSG_RESULT([$SELINUX_MOUNT]) - - SELINUX_LIBS="-lselinux" - AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point]) - AC_DEFINE_UNQUOTED([WITH_SELINUX], 1, [whether basic SELinux functionality is available]) - dnl We prefer to use <selinux/label.h> and selabel_open, but can fall - dnl back to matchpathcon for the sake of RHEL 5's version of libselinux. - AC_CHECK_HEADERS([selinux/label.h]) -fi -AM_CONDITIONAL([WITH_SELINUX], [test "$with_selinux" != "no"]) -AC_SUBST([SELINUX_CFLAGS]) -AC_SUBST([SELINUX_LIBS]) - - AC_ARG_WITH([secdriver-selinux], AC_HELP_STRING([--with-secdriver-selinux], [use SELinux security driver @<:@default=check@:>@]), [], @@ -2944,6 +2890,7 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL +LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) @@ -2982,11 +2929,6 @@ fi else AC_MSG_NOTICE([ polkit: no]) fi -if test "$with_selinux" = "yes" ; then -AC_MSG_NOTICE([ selinux: $SELINUX_CFLAGS $SELINUX_LIBS]) -else -AC_MSG_NOTICE([ selinux: no]) -fi if test "$with_apparmor" = "yes" ; then AC_MSG_NOTICE([apparmor: $APPARMOR_CFLAGS $APPARMOR_LIBS]) else diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 new file mode 100644 index 0000000..abb0d12 --- /dev/null +++ b/m4/virt-selinux.m4 @@ -0,0 +1,51 @@ +dnl The libselinux.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ + LIBVIRT_CHECK_LIB([SELINUX], [selinux], + [fgetfilecon_raw], [selinux/selinux.h]) + + AC_ARG_WITH([selinux_mount], + AC_HELP_STRING([--with-selinux-mount], [set SELinux mount point @<:@default=check@:>@]), + [], + [with_selinux_mount=check]) + + if test "$with_selinux" = "yes"; then + AC_MSG_CHECKING([SELinux mount point]) + if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then + if test -d /sys/fs/selinux ; then + SELINUX_MOUNT=/sys/fs/selinux + else + SELINUX_MOUNT=/selinux + fi + else + SELINUX_MOUNT=$with_selinux_mount + fi + AC_MSG_RESULT([$SELINUX_MOUNT]) + AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point]) + + dnl We prefer to use <selinux/label.h> and selabel_open, but can fall + dnl back to matchpathcon for the sake of RHEL 5's version of libselinux. + AC_CHECK_HEADERS([selinux/label.h]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_SELINUX],[ + LIBVIRT_RESULT_LIB([SELINUX]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 62 ++---------------------------------------------------- m4/virt-selinux.m4 | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 60 deletions(-) create mode 100644 m4/virt-selinux.m4
+ SELINUX_MOUNT=$with_selinux_mount + fi + AC_MSG_RESULT([$SELINUX_MOUNT]) + AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point]) + + dnl We prefer to use <selinux/label.h> and selabel_open, but can fall + dnl back to matchpathcon for the sake of RHEL 5's version of libselinux. + AC_CHECK_HEADERS([selinux/label.h]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_SELINUX],[ + LIBVIRT_RESULT_LIB([SELINUX]) +])
Do we also want to mention the value of $SELINUX_MOUNT in the final wrap-up summary? (That is, have LIBVIRT_RESULT_SELINUX be a call to both LIBVIRT_RESULT_LIB and another line for SELINUX_MOUNT) But that's a change from current behavior, so I'm okay either way. ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 70 +++-------------------------------------------------- m4/virt-apparmor.m4 | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 66 deletions(-) create mode 100644 m4/virt-apparmor.m4 diff --git a/configure.ac b/configure.ac index 79cd132..fa3bfc0 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,7 @@ AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS]) LIBVIRT_COMPILE_WARNINGS +LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -1286,46 +1287,6 @@ fi AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"]) -dnl AppArmor -AC_ARG_WITH([apparmor], - AC_HELP_STRING([--with-apparmor], [use AppArmor to manage security @<:@default=check@:>@]), - [], - [with_apparmor=check]) - -APPARMOR_CFLAGS= -APPARMOR_LIBS= -if test "$with_apparmor" != "no"; then - old_cflags="$CFLAGS" - old_libs="$LIBS" - if test "$with_apparmor" = "check"; then - AC_CHECK_HEADER([sys/apparmor.h],[],[with_apparmor=no]) - AC_CHECK_LIB([apparmor], [aa_change_profile],[],[with_apparmor=no]) - AC_CHECK_LIB([apparmor], [aa_change_hat],[],[with_apparmor=no]) - if test "$with_apparmor" != "no"; then - with_apparmor="yes" - fi - else - fail=0 - AC_CHECK_HEADER([sys/apparmor.h],[],[fail=1]) - AC_CHECK_LIB([apparmor], [aa_change_profile],[],[fail=1]) - AC_CHECK_LIB([apparmor], [aa_change_hat],[],[fail=1]) - test $fail = 1 && - AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) - fi - CFLAGS="$old_cflags" - LIBS="$old_libs" -fi -if test "$with_apparmor" = "yes"; then - APPARMOR_LIBS="-lapparmor" - AC_DEFINE_UNQUOTED([HAVE_APPARMOR], 1, [whether AppArmor is available for security]) - AC_DEFINE_UNQUOTED([APPARMOR_DIR], "/etc/apparmor.d", [path to apparmor directory]) - AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], "/sys/kernel/security/apparmor/profiles", [path to kernel profiles]) -fi -AM_CONDITIONAL([HAVE_APPARMOR], [test "$with_apparmor" != "no"]) -AC_SUBST([APPARMOR_CFLAGS]) -AC_SUBST([APPARMOR_LIBS]) - - AC_ARG_WITH([secdriver-apparmor], AC_HELP_STRING([--with-secdriver-apparmor], [use AppArmor security driver @<:@default=check@:>@]), [], @@ -1339,27 +1300,8 @@ if test "$with_apparmor" != "yes" ; then AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) fi elif test "with_secdriver_apparmor" != "no" ; then - old_cflags="$CFLAGS" - old_libs="$LIBS" - CFLAGS="$CFLAGS $APPARMOR_CFLAGS" - LIBS="$CFLAGS $APPARMOR_LIBS" - - fail=0 - AC_CHECK_FUNC([change_hat], [], [fail=1]) - AC_CHECK_FUNC([aa_change_profile], [], [fail=1]) - CFLAGS="$old_cflags" - LIBS="$old_libs" - - if test "$fail" = "1" ; then - if test "$with_secdriver_apparmor" = "check" ; then - with_secdriver_apparmor=no - else - AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) - fi - else - with_secdriver_apparmor=yes - AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available]) - fi + with_secdriver_apparmor=yes + AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available]) fi AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"]) @@ -2887,6 +2829,7 @@ fi AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) +LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL @@ -2929,11 +2872,6 @@ fi else AC_MSG_NOTICE([ polkit: no]) fi -if test "$with_apparmor" = "yes" ; then -AC_MSG_NOTICE([apparmor: $APPARMOR_CFLAGS $APPARMOR_LIBS]) -else -AC_MSG_NOTICE([apparmor: no]) -fi if test "$with_numactl" = "yes" ; then AC_MSG_NOTICE([ numactl: $NUMACTL_CFLAGS $NUMACTL_LIBS]) else diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 new file mode 100644 index 0000000..7a10c0b --- /dev/null +++ b/m4/virt-apparmor.m4 @@ -0,0 +1,42 @@ +dnl The libapparmor.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ + LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], + [aa_change_profile], [sys/apparmor.h]) + + AC_ARG_WITH([apparmor_mount], + AC_HELP_STRING([--with-apparmor-mount], + [set Apparmor mount point @<:@default=check@:>@]), + [], + [with_apparmor_mount=check]) + + if test "$with_apparmor" = "yes"; then + AC_DEFINE_UNQUOTED([APPARMOR_DIR], + "/etc/apparmor.d", + [path to apparmor directory]) + AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], + "/sys/kernel/security/apparmor/profiles", + [path to kernel profiles]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[ + LIBVIRT_RESULT_LIB([APPARMOR]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 70 +++-------------------------------------------------- m4/virt-apparmor.m4 | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 66 deletions(-) create mode 100644 m4/virt-apparmor.m4
+ + AC_ARG_WITH([apparmor_mount], + AC_HELP_STRING([--with-apparmor-mount], + [set Apparmor mount point @<:@default=check@:>@]),
Isn't the name AppArmor, with camel case? ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Jan 11, 2013 at 02:09:35PM -0700, Eric Blake wrote:
On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 70 +++-------------------------------------------------- m4/virt-apparmor.m4 | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 66 deletions(-) create mode 100644 m4/virt-apparmor.m4
+ + AC_ARG_WITH([apparmor_mount], + AC_HELP_STRING([--with-apparmor-mount], + [set Apparmor mount point @<:@default=check@:>@]),
Isn't the name AppArmor, with camel case?
Yes, fixed Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- docs/hacking.html.in | 2 +- src/lxc/lxc_controller.c | 4 ++-- src/nodeinfo.c | 10 +++++----- src/qemu/qemu_process.c | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index fa3bfc0..a02694b 100644 --- a/configure.ac +++ b/configure.ac @@ -1398,10 +1398,10 @@ if test "$with_numad" = "yes"; then fi if test "$with_numactl" = "yes" || test "$with_numad" = "yes"; then NUMACTL_LIBS="-lnuma" - AC_DEFINE_UNQUOTED([HAVE_NUMACTL], 1, [whether numactl-devel is available]) + AC_DEFINE_UNQUOTED([WITH_NUMACTL], 1, [whether numactl-devel is available]) fi AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) -AM_CONDITIONAL([HAVE_NUMACTL], [test "$with_numad" != "no" || test "$with_numactl" != "no"]) +AM_CONDITIONAL([WITH_NUMACTL], [test "$with_numad" != "no" || test "$with_numactl" != "no"]) AC_SUBST([NUMACTL_CFLAGS]) AC_SUBST([NUMACTL_LIBS]) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 40acdbb..9d1e3ed 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -799,7 +799,7 @@ #include <string.h> #include <limits.h> - #if HAVE_NUMACTL Some system includes aren't supported + #if WITH_NUMACTL Some system includes aren't supported # include <numa.h> everywhere so need these #if guards. #endif diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 3190d8a..5c7be8d 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -46,7 +46,7 @@ # include <cap-ng.h> #endif -#if HAVE_NUMACTL +#if WITH_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 # include <numa.h> #endif @@ -408,7 +408,7 @@ cleanup: return ret; } -#if HAVE_NUMACTL +#if WITH_NUMACTL static int virLXCControllerSetupNUMAPolicy(virLXCControllerPtr ctrl) { nodemask_t mask; diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 57a931b..477104f 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -33,7 +33,7 @@ #include <sched.h> #include "conf/domain_conf.h" -#if HAVE_NUMACTL +#if WITH_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 # include <numa.h> #endif @@ -986,17 +986,17 @@ int nodeGetMemoryStats(virConnectPtr conn ATTRIBUTE_UNUSED, return -1; } } else { -# if HAVE_NUMACTL +# if WITH_NUMACTL if (numa_available() < 0) { # endif virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("NUMA not supported on this host")); return -1; -# if HAVE_NUMACTL +# if WITH_NUMACTL } # endif -# if HAVE_NUMACTL +# if WITH_NUMACTL if (cellNum > numa_max_node()) { virReportInvalidArg(cellNum, _("cellNum in %s must be less than or equal to %d"), @@ -1459,7 +1459,7 @@ cleanup: return ret; } -#if HAVE_NUMACTL +#if WITH_NUMACTL # if LIBNUMA_API_VERSION <= 1 # define NUMA_MAX_N_CPUS 4096 # else diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 320c0c6..713670e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -45,7 +45,7 @@ #include "qemu_bridge_filter.h" #include "qemu_migration.h" -#if HAVE_NUMACTL +#if WITH_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 # include <numa.h> #endif @@ -1839,7 +1839,7 @@ qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver, * Set NUMA memory policy for qemu process, to be run between * fork/exec of QEMU only. */ -#if HAVE_NUMACTL +#if WITH_NUMACTL static int qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, virBitmapPtr nodemask) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- docs/hacking.html.in | 2 +- src/lxc/lxc_controller.c | 4 ++-- src/nodeinfo.c | 10 +++++----- src/qemu/qemu_process.c | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 53 ++++------------------------------------------------- m4/virt-numactl.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 49 deletions(-) create mode 100644 m4/virt-numactl.m4 diff --git a/configure.ac b/configure.ac index a02694b..4c1d12e 100644 --- a/configure.ac +++ b/configure.ac @@ -157,6 +157,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT +LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX @@ -1330,34 +1331,6 @@ fi AM_CONDITIONAL([WITH_DTRACE_PROBES], [test "$with_dtrace" != "no"]) -dnl NUMA lib -AC_ARG_WITH([numactl], - AC_HELP_STRING([--with-numactl], [use numactl for host topology info @<:@default=check@:>@]), - [], - [with_numactl=check]) - -NUMACTL_CFLAGS= -NUMACTL_LIBS= -if test "$with_qemu" = "yes" && test "$with_numactl" != "no"; then - old_cflags="$CFLAGS" - old_libs="$LIBS" - if test "$with_numactl" = "check"; then - AC_CHECK_HEADER([numa.h],[],[with_numactl=no]) - AC_CHECK_LIB([numa], [numa_available],[],[with_numactl=no]) - if test "$with_numactl" != "no"; then - with_numactl="yes" - fi - else - fail=0 - AC_CHECK_HEADER([numa.h],[],[fail=1]) - AC_CHECK_LIB([numa], [numa_available],[],[fail=1]) - test $fail = 1 && - AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt]) - fi - CFLAGS="$old_cflags" - LIBS="$old_libs" -fi - dnl numad AC_ARG_WITH([numad], AC_HELP_STRING([--with-numad], [use numad to manage CPU placement dynamically @<:@default=check@:>@]), @@ -1365,15 +1338,12 @@ AC_ARG_WITH([numad], [with_numad=check]) if test "$with_numad" != "no" ; then - old_cflags="$CFLAGS" - old_libs="$LIBS" fail=0 AC_PATH_PROG([NUMAD], [numad], [], [/bin:/usr/bin]) if test "$with_numad" = "check"; then - AC_CHECK_HEADER([numa.h], [], [fail=1]) - AC_CHECK_LIB([numa], [numa_available], [], [fail=1]) + test "$with_numactl" = "yes" || fail=1 if test -z "$NUMAD" || test $fail = 1; then with_numad="no" else @@ -1383,27 +1353,16 @@ if test "$with_numad" != "no" ; then test -z "$NUMAD" && AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically]) - AC_CHECK_HEADER([numa.h], [], [fail=1]) - AC_CHECK_LIB([numa], [numa_available], [], [fail=1]) + test "$with_numactl" = "yes" || fail=1 test $fail = 1 && AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt]) fi - - CFLAGS="$old_cflags" - LIBS="$old_libs" fi if test "$with_numad" = "yes"; then AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available]) AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program]) fi -if test "$with_numactl" = "yes" || test "$with_numad" = "yes"; then - NUMACTL_LIBS="-lnuma" - AC_DEFINE_UNQUOTED([WITH_NUMACTL], 1, [whether numactl-devel is available]) -fi AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) -AM_CONDITIONAL([WITH_NUMACTL], [test "$with_numad" != "no" || test "$with_numactl" != "no"]) -AC_SUBST([NUMACTL_CFLAGS]) -AC_SUBST([NUMACTL_LIBS]) dnl pcap lib LIBPCAP_CONFIG="pcap-config" @@ -2831,6 +2790,7 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT +LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX @@ -2872,11 +2832,6 @@ fi else AC_MSG_NOTICE([ polkit: no]) fi -if test "$with_numactl" = "yes" ; then -AC_MSG_NOTICE([ numactl: $NUMACTL_CFLAGS $NUMACTL_LIBS]) -else -AC_MSG_NOTICE([ numactl: no]) -fi if test "$with_capng" = "yes" ; then AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS]) else diff --git a/m4/virt-numactl.m4 b/m4/virt-numactl.m4 new file mode 100644 index 0000000..1dcb029 --- /dev/null +++ b/m4/virt-numactl.m4 @@ -0,0 +1,26 @@ +dnl The libnuma.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[ + LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h]) +]) + +AC_DEFUN([LIBVIRT_RESULT_NUMACTL],[ + LIBVIRT_RESULT_LIB([NUMACTL]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 53 ++++------------------------------------------------- m4/virt-numactl.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 49 deletions(-) create mode 100644 m4/virt-numactl.m4
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/lxc/lxc_container.c | 4 ++-- src/lxc/lxc_controller.c | 4 ++-- src/util/vircommand.c | 4 ++-- src/util/virutil.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 4c1d12e..2d8d8e9 100644 --- a/configure.ac +++ b/configure.ac @@ -1515,9 +1515,9 @@ if test "$with_qemu" = "yes" && test "$with_capng" != "no"; then fi if test "$with_capng" = "yes"; then CAPNG_LIBS="-lcap-ng" - AC_DEFINE_UNQUOTED([HAVE_CAPNG], 1, [whether capng is available for privilege reduction]) + AC_DEFINE_UNQUOTED([WITH_CAPNG], 1, [whether capng is available for privilege reduction]) fi -AM_CONDITIONAL([HAVE_CAPNG], [test "$with_capng" != "no"]) +AM_CONDITIONAL([WITH_CAPNG], [test "$with_capng" != "no"]) AC_SUBST([CAPNG_CFLAGS]) AC_SUBST([CAPNG_LIBS]) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index ee1d676..73cffa1 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -45,7 +45,7 @@ /* For MS_MOVE */ #include <linux/fs.h> -#if HAVE_CAPNG +#if WITH_CAPNG # include <cap-ng.h> #endif @@ -2126,7 +2126,7 @@ static int lxcContainerSetupMounts(virDomainDefPtr vmDef, */ static int lxcContainerDropCapabilities(bool keepReboot ATTRIBUTE_UNUSED) { -#if HAVE_CAPNG +#if WITH_CAPNG int ret; capng_get_caps_process(); diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 5c7be8d..76b2986 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -42,7 +42,7 @@ #include <sys/stat.h> #include <time.h> -#if HAVE_CAPNG +#if WITH_CAPNG # include <cap-ng.h> #endif @@ -664,7 +664,7 @@ error: static int lxcControllerClearCapabilities(void) { -#if HAVE_CAPNG +#if WITH_CAPNG int ret; capng_clear(CAPNG_SELECT_BOTH); diff --git a/src/util/vircommand.c b/src/util/vircommand.c index c906f2a..8566d1a 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -29,7 +29,7 @@ #include <sys/wait.h> #include <fcntl.h> -#if HAVE_CAPNG +#if WITH_CAPNG # include <cap-ng.h> #endif @@ -162,7 +162,7 @@ virCommandFDSet(int fd, static int virClearCapabilities(void) ATTRIBUTE_UNUSED; -# if HAVE_CAPNG +# if WITH_CAPNG static int virClearCapabilities(void) { int ret; diff --git a/src/util/virutil.c b/src/util/virutil.c index 7c54bea..b36e9d3 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -58,7 +58,7 @@ # include <pwd.h> # include <grp.h> #endif -#if HAVE_CAPNG +#if WITH_CAPNG # include <cap-ng.h> #endif #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/lxc/lxc_container.c | 4 ++-- src/lxc/lxc_controller.c | 4 ++-- src/util/vircommand.c | 4 ++-- src/util/virutil.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 46 ++-------------------------------------------- m4/virt-capng.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 44 deletions(-) create mode 100644 m4/virt-capng.m4 diff --git a/configure.ac b/configure.ac index 2d8d8e9..afcfd8b 100644 --- a/configure.ac +++ b/configure.ac @@ -157,6 +157,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT +LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -1482,45 +1483,6 @@ AM_CONDITIONAL([HAVE_LIBSSH2], [test "$with_libssh2_transport" = "yes"]) AC_SUBST([LIBSSH2_CFLAGS]) AC_SUBST([LIBSSH2_LIBS]) -dnl libcap-ng -AC_ARG_WITH([capng], - AC_HELP_STRING([--with-capng], [use libcap-ng to reduce libvirtd privileges @<:@default=check@:>@]), - [], - [with_capng=check]) - -dnl -dnl This check looks for 'capng_updatev' since that was -dnl introduced in 0.4.0 release which need as minimum -dnl -CAPNG_CFLAGS= -CAPNG_LIBS= -if test "$with_qemu" = "yes" && test "$with_capng" != "no"; then - old_cflags="$CFLAGS" - old_libs="$LIBS" - if test "$with_capng" = "check"; then - AC_CHECK_HEADER([cap-ng.h],[],[with_capng=no]) - AC_CHECK_LIB([cap-ng], [capng_updatev],[],[with_capng=no]) - if test "$with_capng" != "no"; then - with_capng="yes" - fi - else - fail=0 - AC_CHECK_HEADER([cap-ng.h],[],[fail=1]) - AC_CHECK_LIB([cap-ng], [capng_updatev],[],[fail=1]) - test $fail = 1 && - AC_MSG_ERROR([You must install the capng >= 0.4.0 development package in order to compile and run libvirt]) - fi - CFLAGS="$old_cflags" - LIBS="$old_libs" -fi -if test "$with_capng" = "yes"; then - CAPNG_LIBS="-lcap-ng" - AC_DEFINE_UNQUOTED([WITH_CAPNG], 1, [whether capng is available for privilege reduction]) -fi -AM_CONDITIONAL([WITH_CAPNG], [test "$with_capng" != "no"]) -AC_SUBST([CAPNG_CFLAGS]) -AC_SUBST([CAPNG_LIBS]) - dnl libfuse AC_ARG_WITH([fuse], @@ -2790,6 +2752,7 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT +LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL @@ -2832,11 +2795,6 @@ fi else AC_MSG_NOTICE([ polkit: no]) fi -if test "$with_capng" = "yes" ; then -AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS]) -else -AC_MSG_NOTICE([ capng: no]) -fi if test "$with_fuse" = "yes" ; then AC_MSG_NOTICE([ fuse: $FUSE_CFLAGS $FUSE_LIBS]) else diff --git a/m4/virt-capng.m4 b/m4/virt-capng.m4 new file mode 100644 index 0000000..ab08321 --- /dev/null +++ b/m4/virt-capng.m4 @@ -0,0 +1,26 @@ +dnl The libcapng.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_CAPNG],[ + LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h]) +]) + +AC_DEFUN([LIBVIRT_RESULT_CAPNG],[ + LIBVIRT_RESULT_LIB([CAPNG]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 46 ++-------------------------------------------- m4/virt-capng.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 44 deletions(-) create mode 100644 m4/virt-capng.m4
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 42 ++---------------------------------------- m4/virt-netcf.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 m4/virt-netcf.m4 diff --git a/configure.ac b/configure.ac index afcfd8b..074e64d 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ GNUTLS_REQUIRED="1.0.25" AVAHI_REQUIRED="0.6.0" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" -NETCF_REQUIRED="0.1.4" UDEV_REQUIRED=145 PCIACCESS_REQUIRED=0.10.0 XMLRPC_REQUIRED=1.14.0 @@ -158,6 +157,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_CAPNG +LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -1574,40 +1574,6 @@ if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then fi AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) -dnl netcf library -AC_ARG_WITH([netcf], - AC_HELP_STRING([--with-netcf], [libnetcf support to configure physical host network interfaces @<:@default=check@:>@]), -[], [with_netcf=check]) - -NETCF_CFLAGS= -NETCF_LIBS= -if test "$with_libvirtd" = "no" ; then - with_netcf=no -fi -if test "$with_netcf" = "yes" || test "$with_netcf" = "check"; then - PKG_CHECK_MODULES(NETCF, netcf >= $NETCF_REQUIRED, - [with_netcf=yes], [ - if test "$with_netcf" = "check" ; then - with_netcf=no - else - AC_MSG_ERROR( - [You must install libnetcf >= $NETCF_REQUIRED to compile libvirt]) - fi - ]) - if test "$with_netcf" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_NETCF], 1, - [whether libnetcf is available to configure physical host network interfaces]) - AC_CHECK_LIB([netcf], [ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0]) - if test "$netcf_transactions" = "1" ; then - AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1, - [we have sufficiently new version of netcf for transaction network API]) - fi - fi -fi -AM_CONDITIONAL([WITH_NETCF], [test "$with_netcf" = "yes"]) -AC_SUBST([NETCF_CFLAGS]) -AC_SUBST([NETCF_LIBS]) - AC_ARG_WITH([secrets], AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes]) @@ -2753,6 +2719,7 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_CAPNG +LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL @@ -2825,11 +2792,6 @@ AC_MSG_NOTICE([ udev: $UDEV_CFLAGS $UDEV_LIBS $PCIACCESS_CFLAGS $PCIACCESS_LI else AC_MSG_NOTICE([ udev: no]) fi -if test "$with_netcf" = "yes" ; then -AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $NETCF_LIBS]) -else -AC_MSG_NOTICE([ netcf: no]) -fi if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) else diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 new file mode 100644 index 0000000..49c1f2f --- /dev/null +++ b/m4/virt-netcf.m4 @@ -0,0 +1,40 @@ +dnl The libnetcf.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_NETCF],[ + LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) + + if test "$with_netcf" = "yes" ; then + old_CFLAGS="$CFLAGS" + old_LIBS="$CFLAGS" + CFLAGS="$CFLAGS $NETCF_CFLAGS" + LIBS="$LIBS $NETCF_LIBS" + AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0]) + if test "$netcf_transactions" = "1" ; then + AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1, + [we have sufficiently new version of netcf for transaction network API]) + fi + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_NETCF],[ + LIBVIRT_RESULT_LIB([NETCF]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 42 ++---------------------------------------- m4/virt-netcf.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 m4/virt-netcf.m4
+ +AC_DEFUN([LIBVIRT_CHECK_NETCF],[ + LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) + + if test "$with_netcf" = "yes" ; then + old_CFLAGS="$CFLAGS" + old_LIBS="$CFLAGS" + CFLAGS="$CFLAGS $NETCF_CFLAGS" + LIBS="$LIBS $NETCF_LIBS" + AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0]) + if test "$netcf_transactions" = "1" ; then + AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1,
Autoconf recommends writing that second parameter as [1], not unadorned 1, for consistency; but it doesn't matter in practice. ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Jan 11, 2013 at 03:00:23PM -0700, Eric Blake wrote:
On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 42 ++---------------------------------------- m4/virt-netcf.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 m4/virt-netcf.m4
+ +AC_DEFUN([LIBVIRT_CHECK_NETCF],[ + LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) + + if test "$with_netcf" = "yes" ; then + old_CFLAGS="$CFLAGS" + old_LIBS="$CFLAGS" + CFLAGS="$CFLAGS $NETCF_CFLAGS" + LIBS="$LIBS $NETCF_LIBS" + AC_CHECK_FUNC([ncf_change_begin], [netcf_transactions=1], [netcf_transactions=0]) + if test "$netcf_transactions" = "1" ; then + AC_DEFINE_UNQUOTED([HAVE_NETCF_TRANSACTIONS], 1,
Autoconf recommends writing that second parameter as [1], not unadorned 1, for consistency; but it doesn't matter in practice.
Changed it anyway Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/nwfilter/nwfilter_driver.c | 4 ++-- src/util/virdbus.c | 7 +++---- src/util/virdbus.h | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 074e64d..2893c7b 100644 --- a/configure.ac +++ b/configure.ac @@ -1112,7 +1112,7 @@ if test "$with_dbus" = "yes" || test "$with_dbus" = "check" ; then fi if test "$with_dbus" = "yes" ; then - AC_DEFINE_UNQUOTED([HAVE_DBUS], 1, [enable communication with DBus]) + AC_DEFINE_UNQUOTED([WITH_DBUS], 1, [enable communication with DBus]) save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" @@ -1122,7 +1122,7 @@ if test "$with_dbus" = "yes" ; then LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi -AM_CONDITIONAL([HAVE_DBUS], [test "$with_dbus" = "yes"]) +AM_CONDITIONAL([WITH_DBUS], [test "$with_dbus" = "yes"]) dnl PolicyKit library diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 815f588..b67b704 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -172,9 +172,9 @@ nwfilterDriverStartup(bool privileged ATTRIBUTE_UNUSED, char *base = NULL; DBusConnection *sysbus = NULL; -#if HAVE_DBUS +#if WITH_DBUS sysbus = virDBusGetSystemBus(); -#endif /* HAVE_DBUS */ +#endif /* WITH_DBUS */ if (VIR_ALLOC(driverState) < 0) { virReportOOMError(); diff --git a/src/util/virdbus.c b/src/util/virdbus.c index 127e57f..52b6ca9 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -29,7 +29,7 @@ #define VIR_FROM_THIS VIR_FROM_DBUS -#ifdef HAVE_DBUS +#ifdef WITH_DBUS static DBusConnection *systembus = NULL; static DBusConnection *sessionbus = NULL; @@ -223,7 +223,7 @@ static void virDBusToggleWatch(DBusWatch *watch, (void)virEventUpdateHandle(info->watch, flags); } -#else /* ! HAVE_DBUS */ +#else /* ! WITH_DBUS */ DBusConnection *virDBusGetSystemBus(void) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -237,5 +237,4 @@ DBusConnection *virDBusGetSessionBus(void) "%s", _("DBus support not compiled into this binary")); return NULL; } - -#endif /* ! HAVE_DBUS */ +#endif /* ! WITH_DBUS */ diff --git a/src/util/virdbus.h b/src/util/virdbus.h index e443fbe..a51dba7 100644 --- a/src/util/virdbus.h +++ b/src/util/virdbus.h @@ -22,7 +22,7 @@ #ifndef __VIR_DBUS_H__ # define __VIR_DBUS_H__ -# ifdef HAVE_DBUS +# ifdef WITH_DBUS # include <dbus/dbus.h> # else # define DBusConnection void -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/nwfilter/nwfilter_driver.c | 4 ++-- src/util/virdbus.c | 7 +++---- src/util/virdbus.h | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 34 ++-------------------------------- m4/virt-dbus.m4 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 m4/virt-dbus.m4 diff --git a/configure.ac b/configure.ac index 2893c7b..8a5a513 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,6 @@ LIBNL_REQUIRED="1.1" LIBSSH2_REQUIRED="1.0" LIBSSH2_TRANSPORT_REQUIRED="1.3" LIBBLKID_REQUIRED="2.17" -DBUS_REQUIRED="1.0.0" FUSE_REQUIRED="2.8.6" dnl Checks for C compiler. @@ -157,6 +156,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_CAPNG +LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_SANLOCK @@ -1094,37 +1094,6 @@ AC_SUBST([GNUTLS_CFLAGS]) AC_SUBST([GNUTLS_LIBS]) -dnl DBus library -DBUS_CFLAGS= -DBUS_LIBS= -AC_ARG_WITH([dbus], - AC_HELP_STRING([--with-dbus], [enable communication with DBus @<:@default=check@:>@]), - [], - [with_dbus=check]) -if test "$with_dbus" = "yes" || test "$with_dbus" = "check" ; then - PKG_CHECK_MODULES(DBUS, dbus-1 >= $DBUS_REQUIRED, - [with_dbus=yes], [ - if test "$with_dbus" = "check" ; then - with_dbus=no - else - AC_MSG_ERROR([You must install DBus >= $DBUS_REQUIRED to compile libvirt]) - fi]) -fi - -if test "$with_dbus" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_DBUS], 1, [enable communication with DBus]) - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$LIBS $DBUS_LIBS" - CFLAGS="$CFLAGS $DBUS_CFLAGS" - AC_CHECK_FUNCS([dbus_watch_get_unix_fd]) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi -AM_CONDITIONAL([WITH_DBUS], [test "$with_dbus" = "yes"]) - - dnl PolicyKit library POLKIT_CFLAGS= POLKIT_LIBS= @@ -2719,6 +2688,7 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_CAPNG +LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_SANLOCK diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4 new file mode 100644 index 0000000..16cb864 --- /dev/null +++ b/m4/virt-dbus.m4 @@ -0,0 +1,36 @@ +dnl The libdbus.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_DBUS],[ + LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0]) + + if test "$with_dbus" = "yes" ; then + old_CFLAGS="$CFLAGS" + old_LIBS="$CFLAGS" + CFLAGS="$CFLAGS $DBUS_CFLAGS" + LIBS="$LIBS $DBUS_LIBS" + AC_CHECK_FUNCS([dbus_watch_get_unix_fd]) + CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_DBUS],[ + LIBVIRT_RESULT_LIB([DBUS]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 34 ++-------------------------------- m4/virt-dbus.m4 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 m4/virt-dbus.m4
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/rpc/virnetservermdns.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 8a5a513..c88162e 100644 --- a/configure.ac +++ b/configure.ac @@ -1190,8 +1190,8 @@ if test "x$with_avahi" = "xyes" || test "x$with_avahi" = "xcheck"; then fi ]) if test "x$with_avahi" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_AVAHI], 1, - [whether Avahi is used to broadcast server presence]) + AC_DEFINE_UNQUOTED([WITH_AVAHI], 1, + [whether Avahi is used to broadcast server presense]) fi fi AC_SUBST([AVAHI_CFLAGS]) diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c index b6f8e8e..26e24d5 100644 --- a/src/rpc/virnetservermdns.c +++ b/src/rpc/virnetservermdns.c @@ -29,7 +29,7 @@ #include <stdio.h> #include <stdlib.h> -#if HAVE_AVAHI +#if WITH_AVAHI # include <avahi-client/client.h> # include <avahi-client/publish.h> @@ -56,7 +56,7 @@ struct _virNetServerMDNSEntry { struct _virNetServerMDNSGroup { virNetServerMDNSPtr mdns; -#if HAVE_AVAHI +#if WITH_AVAHI AvahiEntryGroup *handle; #endif char *name; @@ -65,14 +65,14 @@ struct _virNetServerMDNSGroup { }; struct _virNetServerMDNS { -#if HAVE_AVAHI +#if WITH_AVAHI AvahiClient *client; AvahiPoll *poller; #endif virNetServerMDNSGroupPtr group; }; -#if HAVE_AVAHI +#if WITH_AVAHI /* Avahi API requires this struct name in the app :-( */ struct AvahiWatch { int watch; @@ -619,7 +619,7 @@ void virNetServerMDNSEntryFree(virNetServerMDNSEntryPtr entry) VIR_FREE(entry); } -#else /* ! HAVE_AVAHI */ +#else /* ! WITH_AVAHI */ static const char *unsupported = N_("avahi not available at build time"); @@ -692,4 +692,4 @@ virNetServerMDNSEntryFree(virNetServerMDNSEntryPtr entry ATTRIBUTE_UNUSED) VIR_DEBUG("%s", _(unsupported)); } -#endif /* ! HAVE_AVAHI */ +#endif /* ! WITH_AVAHI */ -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/rpc/virnetservermdns.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
- AC_DEFINE_UNQUOTED([HAVE_AVAHI], 1, - [whether Avahi is used to broadcast server presence]) + AC_DEFINE_UNQUOTED([WITH_AVAHI], 1, + [whether Avahi is used to broadcast server presense])
What's up with the added typo? s/presense/presence/ as it used to be. ACK if you undo the spurious word change. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Jan 11, 2013 at 03:05:06PM -0700, Eric Blake wrote:
On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/rpc/virnetservermdns.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
- AC_DEFINE_UNQUOTED([HAVE_AVAHI], 1, - [whether Avahi is used to broadcast server presence]) + AC_DEFINE_UNQUOTED([WITH_AVAHI], 1, + [whether Avahi is used to broadcast server presense])
What's up with the added typo? s/presense/presence/ as it used to be.
ACK if you undo the spurious word change.
This series has been around a while. I guess the typo was fixed in configure.ac and when i rebased I re-introduced it Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 34 ++-------------------------------- m4/virt-avahi.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 m4/virt-avahi.m4 diff --git a/configure.ac b/configure.ac index c88162e..b2960b8 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,6 @@ fi dnl Required minimum versions of all libs we depend on LIBXML_REQUIRED="2.6.0" GNUTLS_REQUIRED="1.0.25" -AVAHI_REQUIRED="0.6.0" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" UDEV_REQUIRED=145 @@ -155,6 +154,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT +LIBVIRT_CHECK_AVAHI LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_NETCF @@ -1171,32 +1171,6 @@ if test "x$with_firewalld" == "xyes" ; then fi AM_CONDITIONAL([HAVE_FIREWALLD], [test "x$with_firewalld" != "xno"]) -dnl Avahi library -AC_ARG_WITH([avahi], - AC_HELP_STRING([--with-avahi], [use avahi to advertise remote daemon @<:@default=check@:>@]), - [], - [with_avahi=check]) - -AVAHI_CFLAGS= -AVAHI_LIBS= -if test "x$with_avahi" = "xyes" || test "x$with_avahi" = "xcheck"; then - PKG_CHECK_MODULES(AVAHI, avahi-client >= $AVAHI_REQUIRED, - [with_avahi=yes], [ - if test "x$with_avahi" = "xcheck" ; then - with_avahi=no - else - AC_MSG_ERROR( - [You must install Avahi >= $AVAHI_REQUIRED to compile libvirt]) - fi - ]) - if test "x$with_avahi" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_AVAHI], 1, - [whether Avahi is used to broadcast server presense]) - fi -fi -AC_SUBST([AVAHI_CFLAGS]) -AC_SUBST([AVAHI_LIBS]) - dnl UUCP style file locks for character devices if test "$with_chrdev_lock_files" != "no"; then @@ -2687,6 +2661,7 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT +LIBVIRT_RESULT_AVAHI LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_NETCF @@ -2718,11 +2693,6 @@ else AC_MSG_NOTICE([ gnutls: no]) fi AC_MSG_NOTICE([firewalld: $with_firewalld]) -if test "$with_avahi" = "yes" ; then -AC_MSG_NOTICE([ avahi: $AVAHI_CFLAGS $AVAHI_LIBS]) -else -AC_MSG_NOTICE([ avahi: no]) -fi if test "$with_polkit" = "yes" ; then if test "$with_polkit0" = "yes" ; then AC_MSG_NOTICE([ polkit: $POLKIT_CFLAGS $POLKIT_LIBS (version 0)]) diff --git a/m4/virt-avahi.m4 b/m4/virt-avahi.m4 new file mode 100644 index 0000000..d0ac86c --- /dev/null +++ b/m4/virt-avahi.m4 @@ -0,0 +1,26 @@ +dnl The libavahi.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ + LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0]) +]) + +AC_DEFUN([LIBVIRT_RESULT_AVAHI],[ + LIBVIRT_RESULT_LIB([AVAHI]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 34 ++-------------------------------- m4/virt-avahi.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 m4/virt-avahi.m4
- AC_HELP_STRING([--with-avahi], [use avahi to advertise remote daemon @<:@default=check@:>@]),
+ +AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ + LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0])
Hmm. I just noticed that the new './configure --help' message is more generic for every library we've been replacing, such as: --with-avahi with libavahi-client support [default=check] Should we enhance LIBVIRT_CHECK_PKG to add an optional fourth parameter, which is additional hint text to add to the AS_HELP_STRING message about WHY using the library might be worthwhile? That is, I'm thinking something like: LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0], [used for advertising remote daemon]) and generating: --with-avahi with libavahi-client support [default=check], used for advertising remote daemon But that's an independent question, and affects ALL of the converted libraries, so it does not prevent me from giving: ACK as-is. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Jan 11, 2013 at 03:11:54PM -0700, Eric Blake wrote:
On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 34 ++-------------------------------- m4/virt-avahi.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 m4/virt-avahi.m4
- AC_HELP_STRING([--with-avahi], [use avahi to advertise remote daemon @<:@default=check@:>@]),
+ +AC_DEFUN([LIBVIRT_CHECK_AVAHI],[ + LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0])
Hmm. I just noticed that the new './configure --help' message is more generic for every library we've been replacing, such as:
--with-avahi with libavahi-client support [default=check]
Should we enhance LIBVIRT_CHECK_PKG to add an optional fourth parameter, which is additional hint text to add to the AS_HELP_STRING message about WHY using the library might be worthwhile? That is, I'm thinking something like:
LIBVIRT_CHECK_PKG([AVAHI], [avahi-client], [0.6.0], [used for advertising remote daemon])
and generating:
--with-avahi with libavahi-client support [default=check], used for advertising remote daemon
But that's an independent question, and affects ALL of the converted libraries, so it does not prevent me from giving:
I guess the problem I'm seeing is that these libraries can be used for many different things, and the macros here don't really know what. It is the hypervisor drivers which know what feature is done by each library. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/Makefile.am | 6 +++--- src/interface/interface_driver.c | 4 ++-- src/node_device/node_device_driver.c | 4 ++-- src/node_device/node_device_driver.h | 2 +- src/storage/storage_backend_scsi.c | 4 ++-- src/util/virstoragefile.c | 2 +- tools/virsh.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index b2960b8..9730de7 100644 --- a/configure.ac +++ b/configure.ac @@ -2336,11 +2336,11 @@ if test "x$with_udev" = "xyes" || test "x$with_udev" = "xcheck"; then ]) fi if test "x$with_udev" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_UDEV], 1, + AC_DEFINE_UNQUOTED([WITH_UDEV], 1, [use UDEV for host device enumeration]) fi fi -AM_CONDITIONAL([HAVE_UDEV], [test "x$with_udev" = "xyes"]) +AM_CONDITIONAL([WITH_UDEV], [test "x$with_udev" = "xyes"]) AC_SUBST([UDEV_CFLAGS]) AC_SUBST([UDEV_LIBS]) AC_SUBST([PCIACCESS_CFLAGS]) diff --git a/src/Makefile.am b/src/Makefile.am index e972671..e9f3fe3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -620,7 +620,7 @@ if WITH_NETCF INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_netcf.c endif -if HAVE_UDEV +if WITH_UDEV INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_udev.c endif @@ -1108,7 +1108,7 @@ if WITH_NETCF libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS) libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS) else -if HAVE_UDEV +if WITH_UDEV libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS) libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS) endif @@ -1222,7 +1222,7 @@ libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS) libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS) endif -if HAVE_UDEV +if WITH_UDEV libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES) libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS) libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS) diff --git a/src/interface/interface_driver.c b/src/interface/interface_driver.c index fbf861e..5668a3f 100644 --- a/src/interface/interface_driver.c +++ b/src/interface/interface_driver.c @@ -28,10 +28,10 @@ interfaceRegister(void) { if (netcfIfaceRegister() == 0) return 0; #endif /* WITH_NETCF */ -#if HAVE_UDEV +#if WITH_UDEV /* If there's no netcf or it failed to load, register the udev backend */ if (udevIfaceRegister() == 0) return 0; -#endif /* HAVE_UDEV */ +#endif /* WITH_UDEV */ return -1; } diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 522af99..9c305a8 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -681,7 +681,7 @@ out: } int nodedevRegister(void) { -#if defined(HAVE_HAL) && defined(HAVE_UDEV) +#if defined(HAVE_HAL) && defined(WITH_UDEV) /* Register only one of these two - they conflict */ if (udevNodeRegister() == -1) return halNodeRegister(); @@ -690,7 +690,7 @@ int nodedevRegister(void) { # ifdef HAVE_HAL return halNodeRegister(); # endif -# ifdef HAVE_UDEV +# ifdef WITH_UDEV return udevNodeRegister(); # endif #endif diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h index 4cec07c..fa7bde1 100644 --- a/src/node_device/node_device_driver.h +++ b/src/node_device/node_device_driver.h @@ -42,7 +42,7 @@ # ifdef HAVE_HAL int halNodeRegister(void); # endif -# ifdef HAVE_UDEV +# ifdef WITH_UDEV int udevNodeRegister(void); # endif diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 1a03c49..90bbf59 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -166,7 +166,7 @@ static char * virStorageBackendSCSISerial(const char *dev) { char *serial = NULL; -#ifdef HAVE_UDEV +#ifdef WITH_UDEV virCommandPtr cmd = virCommandNewArgList( "/lib/udev/scsi_id", "--replace-whitespace", @@ -191,7 +191,7 @@ virStorageBackendSCSISerial(const char *dev) virReportOOMError(); } -#ifdef HAVE_UDEV +#ifdef WITH_UDEV cleanup: virCommandFree(cmd); #endif diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index c7941c3..cdac5b1 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1282,7 +1282,7 @@ int virStorageFileGetLVMKey(const char *path, } #endif -#ifdef HAVE_UDEV +#ifdef WITH_UDEV int virStorageFileGetSCSIKey(const char *path, char **key) { diff --git a/tools/virsh.c b/tools/virsh.c index 283194a..e3bd6ca 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2727,7 +2727,7 @@ vshShowVersion(vshControl *ctl ATTRIBUTE_UNUSED) vshPrint(ctl, " Interface"); # if defined(WITH_NETCF) vshPrint(ctl, " netcf"); -# elif defined(HAVE_UDEV) +# elif defined(WITH_UDEV) vshPrint(ctl, " udev"); # endif #endif -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/Makefile.am | 6 +++--- src/interface/interface_driver.c | 4 ++-- src/node_device/node_device_driver.c | 4 ++-- src/node_device/node_device_driver.h | 2 +- src/storage/storage_backend_scsi.c | 4 ++-- src/util/virstoragefile.c | 2 +- tools/virsh.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 57 ++++------------------------------------------------ m4/virt-pciaccess.m4 | 26 ++++++++++++++++++++++++ m4/virt-udev.m4 | 32 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 53 deletions(-) create mode 100644 m4/virt-pciaccess.m4 create mode 100644 m4/virt-udev.m4 diff --git a/configure.ac b/configure.ac index 9730de7..b96231c 100644 --- a/configure.ac +++ b/configure.ac @@ -100,8 +100,6 @@ LIBXML_REQUIRED="2.6.0" GNUTLS_REQUIRED="1.0.25" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" -UDEV_REQUIRED=145 -PCIACCESS_REQUIRED=0.10.0 XMLRPC_REQUIRED=1.14.0 HAL_REQUIRED=0.5.0 DEVMAPPER_REQUIRED=1.0.0 @@ -159,9 +157,11 @@ LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL +LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX +LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_YAJL AC_MSG_CHECKING([for CPUID instruction]) @@ -2300,52 +2300,6 @@ AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) -dnl udev/libpciaccess library check for alternate host device enumeration -UDEV_CFLAGS= -UDEV_LIBS= -PCIACCESS_CFLAGS= -PCIACCESS_LIBS= -AC_ARG_WITH([udev], - AC_HELP_STRING([--with-udev], [use libudev for host device enumeration @<:@default=check@:>@]), - [], - [with_udev=check]) - -if test "$with_libvirtd" = "no" ; then - with_udev=no -fi -if test "x$with_udev" = "xyes" || test "x$with_udev" = "xcheck"; then - PKG_CHECK_MODULES(UDEV, libudev >= $UDEV_REQUIRED, - [], [ - if test "x$with_udev" = "xcheck" ; then - with_udev=no - else - AC_MSG_ERROR( - [You must install libudev-devel >= $UDEV_REQUIRED to compile libvirt]) - fi - ]) - if test "x$with_udev" != "xno"; then - PKG_CHECK_MODULES(PCIACCESS, pciaccess >= $PCIACCESS_REQUIRED, - [with_udev=yes], - [ - if test "x$with_udev" = "xcheck" ; then - with_udev=no - else - AC_MSG_ERROR( - [You must install libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt]) - fi - ]) - fi - if test "x$with_udev" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_UDEV], 1, - [use UDEV for host device enumeration]) - fi -fi -AM_CONDITIONAL([WITH_UDEV], [test "x$with_udev" = "xyes"]) -AC_SUBST([UDEV_CFLAGS]) -AC_SUBST([UDEV_LIBS]) -AC_SUBST([PCIACCESS_CFLAGS]) -AC_SUBST([PCIACCESS_LIBS]) - with_nodedev=no; if test "$with_hal" = "yes" || test "$with_udev" = "yes"; then @@ -2666,9 +2620,11 @@ LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL +LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX +LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) @@ -2727,11 +2683,6 @@ AC_MSG_NOTICE([ hal: $HAL_CFLAGS $HAL_LIBS]) else AC_MSG_NOTICE([ hal: no]) fi -if test "$with_udev" = "yes" ; then -AC_MSG_NOTICE([ udev: $UDEV_CFLAGS $UDEV_LIBS $PCIACCESS_CFLAGS $PCIACCESS_LIBS]) -else -AC_MSG_NOTICE([ udev: no]) -fi if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) else diff --git a/m4/virt-pciaccess.m4 b/m4/virt-pciaccess.m4 new file mode 100644 index 0000000..2f5c958 --- /dev/null +++ b/m4/virt-pciaccess.m4 @@ -0,0 +1,26 @@ +dnl The libpciaccess.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[ + LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0]) +]) + +AC_DEFUN([LIBVIRT_RESULT_PCIACCESS],[ + LIBVIRT_RESULT_LIB([PCIACCESS]) +]) diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 new file mode 100644 index 0000000..bf4623d --- /dev/null +++ b/m4/virt-udev.m4 @@ -0,0 +1,32 @@ +dnl The libudev.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_UDEV],[ + AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS]) + LIBVIRT_CHECK_PKG([UDEV], [libudev], [145]) + + if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then + AC_MSG_ERROR([You must install the pciaccesss module to build with udev]) + fi +]) + +AC_DEFUN([LIBVIRT_RESULT_UDEV],[ + AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS]) + LIBVIRT_RESULT_LIB([UDEV]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 57 ++++------------------------------------------------ m4/virt-pciaccess.m4 | 26 ++++++++++++++++++++++++ m4/virt-udev.m4 | 32 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 53 deletions(-) create mode 100644 m4/virt-pciaccess.m4 create mode 100644 m4/virt-udev.m4
+AC_DEFUN([LIBVIRT_RESULT_UDEV],[ + AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS]) + LIBVIRT_RESULT_LIB([UDEV]) +])
Ah, we're starting to get pre-req checks. You've been sorting by name, but this will cause results to be topologically sorted (with leaves reverting to sort-by-name). Works for me. ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Jan 11, 2013 at 03:17:01PM -0700, Eric Blake wrote:
On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 57 ++++------------------------------------------------ m4/virt-pciaccess.m4 | 26 ++++++++++++++++++++++++ m4/virt-udev.m4 | 32 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 53 deletions(-) create mode 100644 m4/virt-pciaccess.m4 create mode 100644 m4/virt-udev.m4
+AC_DEFUN([LIBVIRT_RESULT_UDEV],[ + AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS]) + LIBVIRT_RESULT_LIB([UDEV]) +])
Ah, we're starting to get pre-req checks. You've been sorting by name, but this will cause results to be topologically sorted (with leaves reverting to sort-by-name). Works for me.
Yep, this is slightly annoying. I haven't thought of a way to preserve alphabetical sorting, while allowing topological usage of the macros. This will get worse once we remove the explicit calls to all these macros from configure.ac and make the individual hypervisor drivers call the ones they need Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/Makefile.am | 2 +- src/node_device/node_device_driver.c | 6 +++--- src/node_device/node_device_driver.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index b96231c..efb0849 100644 --- a/configure.ac +++ b/configure.ac @@ -2291,11 +2291,11 @@ if test "x$with_hal" = "xyes" || test "x$with_hal" = "xcheck"; then LIBS="$old_LIBS" fi if test "x$with_hal" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_HAL], 1, + AC_DEFINE_UNQUOTED([WITH_HAL], 1, [use HAL for host device enumeration]) fi fi -AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"]) +AM_CONDITIONAL([WITH_HAL], [test "x$with_hal" = "xyes"]) AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) diff --git a/src/Makefile.am b/src/Makefile.am index e9f3fe3..c9e87e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1217,7 +1217,7 @@ libvirt_driver_nodedev_la_CFLAGS = \ libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_nodedev_la_LIBADD = -if HAVE_HAL +if WITH_HAL libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS) libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 9c305a8..2b46041 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -58,7 +58,7 @@ static int update_caps(virNodeDeviceObjPtr dev) } -#if defined (__linux__) && defined (HAVE_HAL) +#if defined (__linux__) && defined (WITH_HAL) /* Under libudev changes to the driver name should be picked up as * "change" events, so we don't call update driver name unless we're * using the HAL backend. */ @@ -681,13 +681,13 @@ out: } int nodedevRegister(void) { -#if defined(HAVE_HAL) && defined(WITH_UDEV) +#if defined(WITH_HAL) && defined(WITH_UDEV) /* Register only one of these two - they conflict */ if (udevNodeRegister() == -1) return halNodeRegister(); return 0; #else -# ifdef HAVE_HAL +# ifdef WITH_HAL return halNodeRegister(); # endif # ifdef WITH_UDEV diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h index fa7bde1..5520740 100644 --- a/src/node_device/node_device_driver.h +++ b/src/node_device/node_device_driver.h @@ -39,7 +39,7 @@ # define LINUX_NEW_DEVICE_WAIT_TIME 60 -# ifdef HAVE_HAL +# ifdef WITH_HAL int halNodeRegister(void); # endif # ifdef WITH_UDEV -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 4 ++-- src/Makefile.am | 2 +- src/node_device/node_device_driver.c | 6 +++--- src/node_device/node_device_driver.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 47 ++--------------------------------------------- m4/virt-hal.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 45 deletions(-) create mode 100644 m4/virt-hal.m4 diff --git a/configure.ac b/configure.ac index efb0849..ede25ca 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ GNUTLS_REQUIRED="1.0.25" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" XMLRPC_REQUIRED=1.14.0 -HAL_REQUIRED=0.5.0 DEVMAPPER_REQUIRED=1.0.0 LIBCURL_REQUIRED="7.18.0" OPENWSMAN_REQUIRED="2.2.3" @@ -155,6 +154,7 @@ LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_AVAHI LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_DBUS +LIBVIRT_CHECK_HAL LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_PCIACCESS @@ -2260,45 +2260,6 @@ test "$enable_shared" = no && lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) -dnl HAL library check for host device enumeration -HAL_CFLAGS= -HAL_LIBS= -AC_ARG_WITH([hal], - AC_HELP_STRING([--with-hal], [use HAL for host device enumeration @<:@default=check@:>@]), - [], - [with_hal=check]) - -if test "$with_libvirtd" = "no" ; then - with_hal=no -fi -if test "x$with_hal" = "xyes" || test "x$with_hal" = "xcheck"; then - PKG_CHECK_MODULES(HAL, hal >= $HAL_REQUIRED, - [with_hal=yes], [ - if test "x$with_hal" = "xcheck" ; then - with_hal=no - else - AC_MSG_ERROR( - [You must install hal-devel >= $HAL_REQUIRED to compile libvirt]) - fi - ]) - if test "x$with_hal" = "xyes" ; then - old_CFLAGS=$CFLAGS - old_LIBS=$LIBS - CFLAGS="$CFLAGS $HAL_CFLAGS" - LIBS="$LIBS $HAL_LIBS" - AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no]) - CFLAGS="$old_CFLAGS" - LIBS="$old_LIBS" - fi - if test "x$with_hal" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_HAL], 1, - [use HAL for host device enumeration]) - fi -fi -AM_CONDITIONAL([WITH_HAL], [test "x$with_hal" = "xyes"]) -AC_SUBST([HAL_CFLAGS]) -AC_SUBST([HAL_LIBS]) - with_nodedev=no; if test "$with_hal" = "yes" || test "$with_udev" = "yes"; @@ -2618,6 +2579,7 @@ LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_AVAHI LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_DBUS +LIBVIRT_RESULT_HAL LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_PCIACCESS @@ -2678,11 +2640,6 @@ AC_MSG_NOTICE([xenlight: $LIBXL_CFLAGS $LIBXL_LIBS]) else AC_MSG_NOTICE([xenlight: no]) fi -if test "$with_hal" = "yes" ; then -AC_MSG_NOTICE([ hal: $HAL_CFLAGS $HAL_LIBS]) -else -AC_MSG_NOTICE([ hal: no]) -fi if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) else diff --git a/m4/virt-hal.m4 b/m4/virt-hal.m4 new file mode 100644 index 0000000..49a8430 --- /dev/null +++ b/m4/virt-hal.m4 @@ -0,0 +1,26 @@ +dnl The libhal.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_HAL],[ + LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0]) +]) + +AC_DEFUN([LIBVIRT_RESULT_HAL],[ + LIBVIRT_RESULT_LIB([HAL]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 47 ++--------------------------------------------- m4/virt-hal.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 45 deletions(-) create mode 100644 m4/virt-hal.m4
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 8 ++++---- src/Makefile.am | 6 +++--- src/lxc/lxc_container.c | 8 ++++---- src/storage/storage_backend_fs.c | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index ede25ca..09e2417 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,7 @@ LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" LIBSSH2_REQUIRED="1.0" LIBSSH2_TRANSPORT_REQUIRED="1.3" -LIBBLKID_REQUIRED="2.17" +BLKID_REQUIRED="2.17" FUSE_REQUIRED="2.8.6" dnl Checks for C compiler. @@ -2315,15 +2315,15 @@ AC_ARG_WITH([libblkid], if test "x$with_libblkid" = "xyes" || test "x$with_libblkid" = "xcheck"; then PKG_CHECK_MODULES([BLKID], - [blkid >= $LIBBLKID_REQUIRED], + [blkid >= $BLKID_REQUIRED], [with_libblkid="yes"], [with_libblkid="no"]) fi if test "x$with_libblkid" = "xyes"; then - AC_DEFINE([HAVE_LIBBLKID], [1], [libblkid is present]) + AC_DEFINE([WITH_BLKID], [1], [libblkid is present]) fi -AM_CONDITIONAL([HAVE_LIBBLKID], [test "x$with_libblkid" = "xyes"]) +AM_CONDITIONAL([WITH_BLKID], [test "x$with_libblkid" = "xyes"]) if test $with_freebsd = yes; then default_qemu_user=root diff --git a/src/Makefile.am b/src/Makefile.am index c9e87e1..8d6e53b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -967,7 +967,7 @@ libvirt_driver_lxc_impl_la_CFLAGS = \ $(FUSE_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS) -if HAVE_LIBBLKID +if WITH_BLKID libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS) libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS) endif @@ -1149,7 +1149,7 @@ endif if WITH_SECDRIVER_APPARMOR libvirt_driver_storage_impl_la_LIBADD += $(APPARMOR_LIBS) endif -if HAVE_LIBBLKID +if WITH_BLKID libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS) libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS) endif @@ -1922,7 +1922,7 @@ libvirt_lxc_CFLAGS = \ $(AM_CFLAGS) \ $(LIBNL_CFLAGS) \ $(FUSE_CFLAGS) -if HAVE_LIBBLKID +if WITH_BLKID libvirt_lxc_CFLAGS += $(BLKID_CFLAGS) libvirt_lxc_LDADD += $(BLKID_LIBS) endif diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 73cffa1..bda326e 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -49,7 +49,7 @@ # include <cap-ng.h> #endif -#if HAVE_LIBBLKID +#if WITH_BLKID # include <blkid/blkid.h> #endif @@ -826,7 +826,7 @@ cleanup: } -#ifdef HAVE_LIBBLKID +#ifdef WITH_BLKID static int lxcContainerMountDetectFilesystem(const char *src, char **type) { @@ -897,7 +897,7 @@ cleanup: blkid_free_probe(blkid); return ret; } -#else /* ! HAVE_LIBBLKID */ +#else /* ! WITH_BLKID */ static int lxcContainerMountDetectFilesystem(const char *src ATTRIBUTE_UNUSED, char **type) @@ -906,7 +906,7 @@ lxcContainerMountDetectFilesystem(const char *src ATTRIBUTE_UNUSED, *type = NULL; return 0; } -#endif /* ! HAVE_LIBBLKID */ +#endif /* ! WITH_BLKID */ /* * This functions attempts to do automatic detection of filesystem diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 2205371..21589a6 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -37,7 +37,7 @@ #include <libxml/tree.h> #include <libxml/xpath.h> -#if HAVE_LIBBLKID +#if WITH_BLKID # include <blkid/blkid.h> #endif @@ -540,7 +540,7 @@ virStorageBackendFileSystemStart(virConnectPtr conn ATTRIBUTE_UNUSED, } #endif /* WITH_STORAGE_FS */ -#if HAVE_LIBBLKID +#if WITH_BLKID static virStoragePoolProbeResult virStorageBackendFileSystemProbe(const char *device, const char *format) { @@ -611,7 +611,7 @@ error: return ret; } -#else /* #if HAVE_LIBBLKID */ +#else /* #if WITH_BLKID */ static virStoragePoolProbeResult virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED, @@ -624,7 +624,7 @@ virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED, return FILESYSTEM_PROBE_ERROR; } -#endif /* #if HAVE_LIBBLKID */ +#endif /* #if WITH_BLKID */ /* some platforms don't support mkfs */ #ifdef MKFS -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 8 ++++---- src/Makefile.am | 6 +++--- src/lxc/lxc_container.c | 8 ++++---- src/storage/storage_backend_fs.c | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 22 ++-------------------- m4/virt-blkid.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 m4/virt-blkid.m4 diff --git a/configure.ac b/configure.ac index 09e2417..6b18ef0 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" LIBSSH2_REQUIRED="1.0" LIBSSH2_TRANSPORT_REQUIRED="1.3" -BLKID_REQUIRED="2.17" FUSE_REQUIRED="2.8.6" dnl Checks for C compiler. @@ -152,6 +151,7 @@ LIBVIRT_COMPILE_WARNINGS LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_AVAHI +LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_HAL @@ -2305,25 +2305,6 @@ if test "$with_interface" = "yes" ; then fi AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) -dnl libblkid is used by several storage drivers; therefore we probe -dnl for it unconditionally. -AC_ARG_WITH([libblkid], - [AS_HELP_STRING([--with-libblkid], - [use libblkid to scan for filesystems and partitions @<:@default=check@:>@])], - [], - [with_libblkid=check]) - -if test "x$with_libblkid" = "xyes" || test "x$with_libblkid" = "xcheck"; then - PKG_CHECK_MODULES([BLKID], - [blkid >= $BLKID_REQUIRED], - [with_libblkid="yes"], - [with_libblkid="no"]) -fi - -if test "x$with_libblkid" = "xyes"; then - AC_DEFINE([WITH_BLKID], [1], [libblkid is present]) -fi -AM_CONDITIONAL([WITH_BLKID], [test "x$with_libblkid" = "xyes"]) if test $with_freebsd = yes; then default_qemu_user=root @@ -2577,6 +2558,7 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_AVAHI +LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_HAL diff --git a/m4/virt-blkid.m4 b/m4/virt-blkid.m4 new file mode 100644 index 0000000..69b7cf4 --- /dev/null +++ b/m4/virt-blkid.m4 @@ -0,0 +1,26 @@ +dnl The libblkid.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_BLKID],[ + LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17]) +]) + +AC_DEFUN([LIBVIRT_RESULT_BLKID],[ + LIBVIRT_RESULT_LIB([BLKID]) +]) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 22 ++-------------------- m4/virt-blkid.m4 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 m4/virt-blkid.m4
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 4 ++-- daemon/libvirtd.c | 14 +++++++------- daemon/remote.c | 2 +- src/Makefile.am | 2 +- src/libvirt.c | 8 ++++---- src/locking/lock_daemon.c | 4 ++-- src/lxc/lxc_controller.c | 2 +- src/qemu/qemu_migration.c | 10 +++++----- src/remote/remote_driver.c | 10 +++++----- src/rpc/virnetclient.c | 12 ++++++------ src/rpc/virnetclient.h | 6 +++--- src/rpc/virnetserver.c | 6 +++--- src/rpc/virnetserver.h | 4 ++-- src/rpc/virnetserverclient.c | 40 ++++++++++++++++++++-------------------- src/rpc/virnetserverclient.h | 4 ++-- src/rpc/virnetserverservice.c | 18 +++++++++--------- src/rpc/virnetserverservice.h | 8 ++++---- src/rpc/virnetsocket.c | 16 ++++++++-------- src/rpc/virnetsocket.h | 4 ++-- tests/Makefile.am | 4 ++-- 20 files changed, 89 insertions(+), 89 deletions(-) diff --git a/configure.ac b/configure.ac index 6b18ef0..cd00899 100644 --- a/configure.ac +++ b/configure.ac @@ -1086,10 +1086,10 @@ if test "x$with_gnutls" != "xno"; then fi if test "x$with_gnutls" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_GNUTLS], 1, + AC_DEFINE_UNQUOTED([WITH_GNUTLS], 1, [whether GNUTLS is available for encryption]) fi -AM_CONDITIONAL([HAVE_GNUTLS], [test "x$with_gnutls" = "xyes"]) +AM_CONDITIONAL([WITH_GNUTLS], [test "x$with_gnutls" = "xyes"]) AC_SUBST([GNUTLS_CFLAGS]) AC_SUBST([GNUTLS_LIBS]) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 7a51387..9cdf4d9 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -449,7 +449,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, virNetServerServicePtr svc = NULL; virNetServerServicePtr svcRO = NULL; virNetServerServicePtr svcTCP = NULL; -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetServerServicePtr svcTLS = NULL; #endif gid_t unix_sock_gid = 0; @@ -476,7 +476,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, unix_sock_rw_mask, unix_sock_gid, config->auth_unix_rw, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif false, @@ -488,7 +488,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, unix_sock_ro_mask, unix_sock_gid, config->auth_unix_ro, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif true, @@ -513,7 +513,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, if (!(svcTCP = virNetServerServiceNewTCP(config->listen_addr, config->tcp_port, config->auth_tcp, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif false, @@ -525,7 +525,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, goto error; } -#if HAVE_GNUTLS +#if WITH_GNUTLS if (config->listen_tls) { virNetTLSContextPtr ctxt = NULL; @@ -581,7 +581,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, #if WITH_SASL if (config->auth_unix_rw == REMOTE_AUTH_SASL || config->auth_unix_ro == REMOTE_AUTH_SASL || -# if HAVE_GNUTLS +# if WITH_GNUTLS config->auth_tls == REMOTE_AUTH_SASL || # endif config->auth_tcp == REMOTE_AUTH_SASL) { @@ -595,7 +595,7 @@ static int daemonSetupNetworking(virNetServerPtr srv, return 0; error: -#if HAVE_GNUTLS +#if WITH_GNUTLS virObjectUnref(svcTLS); #endif virObjectUnref(svcTCP); diff --git a/daemon/remote.c b/daemon/remote.c index 1a0af7e..7b1f8eb 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2464,7 +2464,7 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED, if (!sasl) goto authfail; -# if HAVE_GNUTLS +# if WITH_GNUTLS /* Inform SASL that we've got an external SSF layer from TLS */ if (virNetServerClientHasTLSSession(client)) { int ssf; diff --git a/src/Makefile.am b/src/Makefile.am index 8d6e53b..ede67e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1779,7 +1779,7 @@ else EXTRA_DIST += \ rpc/virnetsshsession.h rpc/virnetsshsession.c endif -if HAVE_GNUTLS +if WITH_GNUTLS libvirt_net_rpc_la_SOURCES += \ rpc/virnettlscontext.h rpc/virnettlscontext.c else diff --git a/src/libvirt.c b/src/libvirt.c index a783fa6..1490738 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -55,7 +55,7 @@ #include "configmake.h" #include "intprops.h" #include "virconf.h" -#if HAVE_GNUTLS +#if WITH_GNUTLS # include "rpc/virnettlscontext.h" #endif #include "vircommand.h" @@ -271,7 +271,7 @@ winsock_init(void) #endif -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS static int virTLSMutexInit(void **priv) { virMutexPtr lock = NULL; @@ -408,14 +408,14 @@ virGlobalInit(void) virErrorInitialize() < 0) goto error; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS gcry_control(GCRYCTL_SET_THREAD_CBS, &virTLSThreadImpl); gcry_check_version(NULL); #endif virLogSetFromEnv(); -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virNetTLSInit(); #endif diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index ba42c00..f0eba48 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -655,7 +655,7 @@ virLockDaemonSetupNetworkingSystemD(virNetServerPtr srv) /* Systemd passes FDs, starting immediately after stderr, * so the first FD we'll get is '3'. */ if (!(svc = virNetServerServiceNewFD(3, 0, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif false, 1))) @@ -677,7 +677,7 @@ virLockDaemonSetupNetworkingNative(virNetServerPtr srv, const char *sock_path) VIR_DEBUG("Setting up networking natively"); if (!(svc = virNetServerServiceNewUNIX(sock_path, 0700, 0, 0, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif false, 1))) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 76b2986..2673f72 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -631,7 +631,7 @@ static int virLXCControllerSetupServer(virLXCControllerPtr ctrl) 0700, 0, 0, -#if HAVE_GNUTLS +#if WITH_GNUTLS NULL, #endif false, diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index e235677..f17c7ff 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -23,7 +23,7 @@ #include <config.h> #include <sys/time.h> -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS # include <gnutls/gnutls.h> # include <gnutls/x509.h> #endif @@ -198,7 +198,7 @@ static void qemuMigrationCookieFree(qemuMigrationCookiePtr mig) } -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS static char * qemuDomainExtractTLSSubject(const char *certdir) { @@ -276,7 +276,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver, if (!listenAddr) listenAddr = driver->vncListen; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS if (driver->vncTLS && !(mig->tlsSubject = qemuDomainExtractTLSSubject(driver->vncTLSx509certdir))) goto error; @@ -291,7 +291,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver, if (!listenAddr) listenAddr = driver->spiceListen; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS if (driver->spiceTLS && !(mig->tlsSubject = qemuDomainExtractTLSSubject(driver->spiceTLSx509certdir))) goto error; @@ -304,7 +304,7 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver, no_memory: virReportOOMError(); -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS error: #endif qemuMigrationCookieGraphicsFree(mig); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 862e474..dcb06c9 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -80,7 +80,7 @@ struct private_data { int counter; /* Serial number for RPC */ -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virNetTLSContextPtr tls; #endif @@ -598,7 +598,7 @@ doRemoteOpen(virConnectPtr conn, /* Connect to the remote service. */ switch (transport) { case trans_tls: -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS priv->tls = virNetTLSContextNewClientPath(pkipath, geteuid() != 0 ? true : false, sanity, verify); @@ -618,7 +618,7 @@ doRemoteOpen(virConnectPtr conn, if (!priv->client) goto failed; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS if (priv->tls) { VIR_DEBUG("Starting TLS session"); if (virNetClientSetTLSSession(priv->client, priv->tls) < 0) @@ -1012,7 +1012,7 @@ doRemoteClose(virConnectPtr conn, struct private_data *priv) (xdrproc_t) xdr_void, (char *) NULL) == -1) ret = -1; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virObjectUnref(priv->tls); priv->tls = NULL; #endif @@ -3893,7 +3893,7 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, saslcb))) goto cleanup; -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS /* Initialize some connection props we care about */ if (priv->tls) { if ((ssf = virNetClientGetTLSKeySize(priv->client)) < 0) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 10ed4f0..69c4478 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -70,7 +70,7 @@ struct _virNetClient { virNetSocketPtr sock; bool asyncIO; -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSSessionPtr tls; #endif char *hostname; @@ -629,7 +629,7 @@ void virNetClientDispose(void *obj) if (client->sock) virNetSocketRemoveIOCallback(client->sock); virObjectUnref(client->sock); -#if HAVE_GNUTLS +#if WITH_GNUTLS virObjectUnref(client->tls); #endif #if WITH_SASL @@ -667,7 +667,7 @@ virNetClientCloseLocked(virNetClientPtr client) virObjectUnref(client->sock); client->sock = NULL; -#if HAVE_GNUTLS +#if WITH_GNUTLS virObjectUnref(client->tls); client->tls = NULL; #endif @@ -751,7 +751,7 @@ void virNetClientSetSASLSession(virNetClientPtr client, #endif -#if HAVE_GNUTLS +#if WITH_GNUTLS int virNetClientSetTLSSession(virNetClientPtr client, virNetTLSContextPtr tls) { @@ -860,7 +860,7 @@ bool virNetClientIsEncrypted(virNetClientPtr client) { bool ret = false; virNetClientLock(client); -#if HAVE_GNUTLS +#if WITH_GNUTLS if (client->tls) ret = true; #endif @@ -966,7 +966,7 @@ const char *virNetClientRemoteAddrString(virNetClientPtr client) return virNetSocketRemoteAddrString(client->sock); } -#if HAVE_GNUTLS +#if WITH_GNUTLS int virNetClientGetTLSKeySize(virNetClientPtr client) { int ret = 0; diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index 7e35b9c..99ea263 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -23,7 +23,7 @@ #ifndef __VIR_NET_CLIENT_H__ # define __VIR_NET_CLIENT_H__ -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS # include "virnettlscontext.h" # endif # include "virnetmessage.h" @@ -109,7 +109,7 @@ void virNetClientSetSASLSession(virNetClientPtr client, virNetSASLSessionPtr sasl); # endif -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS int virNetClientSetTLSSession(virNetClientPtr client, virNetTLSContextPtr tls); # endif @@ -120,7 +120,7 @@ bool virNetClientIsOpen(virNetClientPtr client); const char *virNetClientLocalAddrString(virNetClientPtr client); const char *virNetClientRemoteAddrString(virNetClientPtr client); -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS int virNetClientGetTLSKeySize(virNetClientPtr client); # endif diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index b9df71b..a937eda 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -98,7 +98,7 @@ struct _virNetServer { unsigned int quit :1; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virNetTLSContextPtr tls; #endif @@ -311,7 +311,7 @@ static int virNetServerDispatchNewClient(virNetServerServicePtr svc, virNetServerServiceGetAuth(svc), virNetServerServiceIsReadonly(svc), virNetServerServiceGetMaxRequests(svc), -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetServerServiceGetTLSContext(svc), #endif srv->clientPrivNew, @@ -1038,7 +1038,7 @@ no_memory: return -1; } -#if HAVE_GNUTLS +#if WITH_GNUTLS int virNetServerSetTLSContext(virNetServerPtr srv, virNetTLSContextPtr tls) { diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index d906dd1..1a85c02 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -26,7 +26,7 @@ # include <signal.h> -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS # include "virnettlscontext.h" # endif # include "virnetserverprogram.h" @@ -81,7 +81,7 @@ int virNetServerAddService(virNetServerPtr srv, int virNetServerAddProgram(virNetServerPtr srv, virNetServerProgramPtr prog); -# if HAVE_GNUTLS +# if WITH_GNUTLS int virNetServerSetTLSContext(virNetServerPtr srv, virNetTLSContextPtr tls); # endif diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 05e0e06..bd4e66f 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -66,7 +66,7 @@ struct _virNetServerClient int auth; bool readonly; char *identity; -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr tlsCtxt; virNetTLSSessionPtr tls; #endif @@ -149,7 +149,7 @@ virNetServerClientCalculateHandleMode(virNetServerClientPtr client) { VIR_DEBUG("tls=%p hs=%d, rx=%p tx=%p", -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS client->tls, client->tls ? virNetTLSSessionGetHandshakeStatus(client->tls) : -1, #else @@ -160,7 +160,7 @@ virNetServerClientCalculateHandleMode(virNetServerClientPtr client) { if (!client->sock || client->wantClose) return 0; -#if HAVE_GNUTLS +#if WITH_GNUTLS if (client->tls) { switch (virNetTLSSessionGetHandshakeStatus(client->tls)) { case VIR_NET_TLS_HANDSHAKE_RECVING: @@ -188,7 +188,7 @@ virNetServerClientCalculateHandleMode(virNetServerClientPtr client) { then monitor for writability on socket */ if (client->tx) mode |= VIR_EVENT_HANDLE_WRITABLE; -#if HAVE_GNUTLS +#if WITH_GNUTLS } #endif VIR_DEBUG("mode=%o", mode); @@ -297,7 +297,7 @@ void virNetServerClientRemoveFilter(virNetServerClientPtr client, } -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS /* Check the client's access. */ static int virNetServerClientCheckAccess(virNetServerClientPtr client) @@ -353,7 +353,7 @@ static void virNetServerClientSockTimerFunc(int timer, static virNetServerClientPtr virNetServerClientNewInternal(virNetSocketPtr sock, int auth, -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virNetTLSContextPtr tls, #endif bool readonly, @@ -375,7 +375,7 @@ virNetServerClientNewInternal(virNetSocketPtr sock, client->sock = virObjectRef(sock); client->auth = auth; client->readonly = readonly; -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS client->tlsCtxt = virObjectRef(tls); #endif client->nrequests_max = nrequests_max; @@ -411,7 +411,7 @@ virNetServerClientPtr virNetServerClientNew(virNetSocketPtr sock, int auth, bool readonly, size_t nrequests_max, -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS virNetTLSContextPtr tls, #endif virNetServerClientPrivNew privNew, @@ -422,7 +422,7 @@ virNetServerClientPtr virNetServerClientNew(virNetSocketPtr sock, virNetServerClientPtr client; VIR_DEBUG("sock=%p auth=%d tls=%p", sock, auth, -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS tls #else NULL @@ -430,7 +430,7 @@ virNetServerClientPtr virNetServerClientNew(virNetSocketPtr sock, ); if (!(client = virNetServerClientNewInternal(sock, auth, -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS tls, #endif readonly, nrequests_max))) @@ -499,7 +499,7 @@ virNetServerClientPtr virNetServerClientNewPostExecRestart(virJSONValuePtr objec if (!(client = virNetServerClientNewInternal(sock, auth, -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS NULL, #endif readonly, @@ -602,7 +602,7 @@ bool virNetServerClientGetReadonly(virNetServerClientPtr client) } -#ifdef HAVE_GNUTLS +#ifdef WITH_GNUTLS bool virNetServerClientHasTLSSession(virNetServerClientPtr client) { bool has; @@ -648,7 +648,7 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client) { bool secure = false; virNetServerClientLock(client); -#if HAVE_GNUTLS +#if WITH_GNUTLS if (client->tls) secure = true; #endif @@ -765,7 +765,7 @@ void virNetServerClientDispose(void *obj) #endif if (client->sockTimer > 0) virEventRemoveTimeout(client->sockTimer); -#if HAVE_GNUTLS +#if WITH_GNUTLS virObjectUnref(client->tls); virObjectUnref(client->tlsCtxt); #endif @@ -821,7 +821,7 @@ void virNetServerClientClose(virNetServerClientPtr client) if (client->sock) virNetSocketRemoveIOCallback(client->sock); -#if HAVE_GNUTLS +#if WITH_GNUTLS if (client->tls) { virObjectUnref(client->tls); client->tls = NULL; @@ -886,13 +886,13 @@ int virNetServerClientInit(virNetServerClientPtr client) { virNetServerClientLock(client); -#if HAVE_GNUTLS +#if WITH_GNUTLS if (!client->tlsCtxt) { #endif /* Plain socket, so prepare to read first message */ if (virNetServerClientRegisterEvent(client) < 0) goto error; -#if HAVE_GNUTLS +#if WITH_GNUTLS } else { int ret; @@ -1224,7 +1224,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client) } -#if HAVE_GNUTLS +#if WITH_GNUTLS static void virNetServerClientDispatchHandshake(virNetServerClientPtr client) { @@ -1264,7 +1264,7 @@ virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque) if (events & (VIR_EVENT_HANDLE_WRITABLE | VIR_EVENT_HANDLE_READABLE)) { -#if HAVE_GNUTLS +#if WITH_GNUTLS if (client->tls && virNetTLSSessionGetHandshakeStatus(client->tls) != VIR_NET_TLS_HANDSHAKE_COMPLETE) { @@ -1276,7 +1276,7 @@ virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque) if (events & VIR_EVENT_HANDLE_READABLE && client->rx) virNetServerClientDispatchRead(client); -#if HAVE_GNUTLS +#if WITH_GNUTLS } #endif } diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index 40010c8..325f5d9 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -52,7 +52,7 @@ virNetServerClientPtr virNetServerClientNew(virNetSocketPtr sock, int auth, bool readonly, size_t nrequests_max, -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS virNetTLSContextPtr tls, # endif virNetServerClientPrivNew privNew, @@ -78,7 +78,7 @@ void virNetServerClientRemoveFilter(virNetServerClientPtr client, int virNetServerClientGetAuth(virNetServerClientPtr client); bool virNetServerClientGetReadonly(virNetServerClientPtr client); -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS bool virNetServerClientHasTLSSession(virNetServerClientPtr client); int virNetServerClientGetTLSKeySize(virNetServerClientPtr client); # endif diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c index 61dd682..b39f0ef 100644 --- a/src/rpc/virnetserverservice.c +++ b/src/rpc/virnetserverservice.c @@ -41,7 +41,7 @@ struct _virNetServerService { bool readonly; size_t nrequests_client_max; -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr tls; #endif @@ -92,7 +92,7 @@ cleanup: virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, const char *service, int auth, -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr tls, #endif bool readonly, @@ -110,7 +110,7 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, svc->auth = auth; svc->readonly = readonly; svc->nrequests_client_max = nrequests_client_max; -#if HAVE_GNUTLS +#if WITH_GNUTLS svc->tls = virObjectRef(tls); #endif @@ -150,7 +150,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, mode_t mask, gid_t grp, int auth, -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr tls, #endif bool readonly, @@ -168,7 +168,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, svc->auth = auth; svc->readonly = readonly; svc->nrequests_client_max = nrequests_client_max; -#if HAVE_GNUTLS +#if WITH_GNUTLS svc->tls = virObjectRef(tls); #endif @@ -212,7 +212,7 @@ error: virNetServerServicePtr virNetServerServiceNewFD(int fd, int auth, -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr tls, #endif bool readonly, @@ -230,7 +230,7 @@ virNetServerServicePtr virNetServerServiceNewFD(int fd, svc->auth = auth; svc->readonly = readonly; svc->nrequests_client_max = nrequests_client_max; -#if HAVE_GNUTLS +#if WITH_GNUTLS svc->tls = virObjectRef(tls); #endif @@ -415,7 +415,7 @@ size_t virNetServerServiceGetMaxRequests(virNetServerServicePtr svc) return svc->nrequests_client_max; } -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSContextPtr virNetServerServiceGetTLSContext(virNetServerServicePtr svc) { return svc->tls; @@ -440,7 +440,7 @@ void virNetServerServiceDispose(void *obj) virObjectUnref(svc->socks[i]); VIR_FREE(svc->socks); -#if HAVE_GNUTLS +#if WITH_GNUTLS virObjectUnref(svc->tls); #endif } diff --git a/src/rpc/virnetserverservice.h b/src/rpc/virnetserverservice.h index 934b8d3..1ece503 100644 --- a/src/rpc/virnetserverservice.h +++ b/src/rpc/virnetserverservice.h @@ -40,7 +40,7 @@ typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr svc, virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, const char *service, int auth, -# if HAVE_GNUTLS +# if WITH_GNUTLS virNetTLSContextPtr tls, # endif bool readonly, @@ -49,14 +49,14 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, mode_t mask, gid_t grp, int auth, -# if HAVE_GNUTLS +# if WITH_GNUTLS virNetTLSContextPtr tls, # endif bool readonly, size_t nrequests_client_max); virNetServerServicePtr virNetServerServiceNewFD(int fd, int auth, -# if HAVE_GNUTLS +# if WITH_GNUTLS virNetTLSContextPtr tls, # endif bool readonly, @@ -71,7 +71,7 @@ int virNetServerServiceGetPort(virNetServerServicePtr svc); int virNetServerServiceGetAuth(virNetServerServicePtr svc); bool virNetServerServiceIsReadonly(virNetServerServicePtr svc); size_t virNetServerServiceGetMaxRequests(virNetServerServicePtr svc); -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS virNetTLSContextPtr virNetServerServiceGetTLSContext(virNetServerServicePtr svc); # endif diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 549aabe..7364482 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -79,7 +79,7 @@ struct _virNetSocket { char *localAddrStr; char *remoteAddrStr; -#if HAVE_GNUTLS +#if WITH_GNUTLS virNetTLSSessionPtr tlsSession; #endif #if WITH_SASL @@ -950,7 +950,7 @@ virJSONValuePtr virNetSocketPreExecRestart(virNetSocketPtr sock) goto error; } #endif -#if HAVE_GNUTLS +#if WITH_GNUTLS if (sock->tlsSession) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Unable to save socket state when TLS session is active")); @@ -1015,7 +1015,7 @@ void virNetSocketDispose(void *obj) unlink(sock->localAddr.data.un.sun_path); #endif -#if HAVE_GNUTLS +#if WITH_GNUTLS /* Make sure it can't send any more I/O during shutdown */ if (sock->tlsSession) virNetTLSSessionSetIOCallbacks(sock->tlsSession, NULL, NULL, NULL); @@ -1184,7 +1184,7 @@ const char *virNetSocketRemoteAddrString(virNetSocketPtr sock) } -#if HAVE_GNUTLS +#if WITH_GNUTLS static ssize_t virNetSocketTLSSessionWrite(const char *buf, size_t len, void *opaque) @@ -1287,7 +1287,7 @@ static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len) #endif reread: -#if HAVE_GNUTLS +#if WITH_GNUTLS if (sock->tlsSession && virNetTLSSessionGetHandshakeStatus(sock->tlsSession) == VIR_NET_TLS_HANDSHAKE_COMPLETE) { @@ -1295,7 +1295,7 @@ reread: } else { #endif ret = read(sock->fd, buf, len); -#if HAVE_GNUTLS +#if WITH_GNUTLS } #endif @@ -1346,7 +1346,7 @@ static ssize_t virNetSocketWriteWire(virNetSocketPtr sock, const char *buf, size #endif rewrite: -#if HAVE_GNUTLS +#if WITH_GNUTLS if (sock->tlsSession && virNetTLSSessionGetHandshakeStatus(sock->tlsSession) == VIR_NET_TLS_HANDSHAKE_COMPLETE) { @@ -1354,7 +1354,7 @@ rewrite: } else { #endif ret = write(sock->fd, buf, len); -#if HAVE_GNUTLS +#if WITH_GNUTLS } #endif diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index f1cb2ab..13583f8 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -26,7 +26,7 @@ # include "virsocketaddr.h" # include "vircommand.h" -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS # include "virnettlscontext.h" # endif # include "virobject.h" @@ -124,7 +124,7 @@ ssize_t virNetSocketWrite(virNetSocketPtr sock, const char *buf, size_t len); int virNetSocketSendFD(virNetSocketPtr sock, int fd); int virNetSocketRecvFD(virNetSocketPtr sock, int *fd); -# ifdef HAVE_GNUTLS +# ifdef WITH_GNUTLS void virNetSocketSetTLSSession(virNetSocketPtr sock, virNetTLSSessionPtr sess); # endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 0e5aec4..6f0dde5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -100,7 +100,7 @@ test_programs = virshtest sockettest \ sysinfotest \ $(NULL) -if HAVE_GNUTLS +if WITH_GNUTLS test_programs += virnettlscontexttest endif @@ -530,7 +530,7 @@ virnetsockettest_SOURCES = \ virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS) virnetsockettest_LDADD = $(LDADDS) -if HAVE_GNUTLS +if WITH_GNUTLS virnettlscontexttest_SOURCES = \ virnettlscontexttest.c testutils.h testutils.c virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS) -- 1.7.11.7

On 01/11/2013 04:05 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 4 ++-- daemon/libvirtd.c | 14 +++++++------- daemon/remote.c | 2 +- src/Makefile.am | 2 +- src/libvirt.c | 8 ++++---- src/locking/lock_daemon.c | 4 ++-- src/lxc/lxc_controller.c | 2 +- src/qemu/qemu_migration.c | 10 +++++----- src/remote/remote_driver.c | 10 +++++-----
The number of non-rpc files we are touching is just evidence of how we haven't done a good job of encapsulating things behind appropriate wrappers. But that is independent of this patch series.
src/rpc/virnetclient.c | 12 ++++++------ src/rpc/virnetclient.h | 6 +++--- src/rpc/virnetserver.c | 6 +++--- src/rpc/virnetserver.h | 4 ++-- src/rpc/virnetserverclient.c | 40 ++++++++++++++++++++-------------------- src/rpc/virnetserverclient.h | 4 ++-- src/rpc/virnetserverservice.c | 18 +++++++++--------- src/rpc/virnetserverservice.h | 8 ++++---- src/rpc/virnetsocket.c | 16 ++++++++-------- src/rpc/virnetsocket.h | 4 ++-- tests/Makefile.am | 4 ++-- 20 files changed, 89 insertions(+), 89 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 4 ++-- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_fuse.c | 2 +- src/lxc/lxc_fuse.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cd00899..313b6dc 100644 --- a/configure.ac +++ b/configure.ac @@ -1440,7 +1440,7 @@ AS_IF([test "x$with_fuse" != "xno"], [with_fuse=yes AC_SUBST([FUSE_CFLAGS]) AC_SUBST([FUSE_LIBS]) - AC_DEFINE_UNQUOTED([HAVE_FUSE], 1, [whether fuse is available for libvirt lxc]) + AC_DEFINE_UNQUOTED([WITH_FUSE], 1, [whether fuse is available for libvirt lxc]) ], [if test "x$with_fuse" = "xyes" ; then AC_MSG_ERROR([You must install fuse library to compile libvirt]) @@ -1449,7 +1449,7 @@ AS_IF([test "x$with_fuse" != "xno"], fi ]) ]) -AM_CONDITIONAL([HAVE_FUSE], [test "x$with_fuse" = "xyes"]) +AM_CONDITIONAL([WITH_FUSE], [test "x$with_fuse" = "xyes"]) dnl virsh libraries AC_CHECK_HEADERS([readline/readline.h]) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index bda326e..25701fe 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -596,7 +596,7 @@ cleanup: return rc; } -#if HAVE_FUSE +#if WITH_FUSE static int lxcContainerMountProcFuse(virDomainDefPtr def, const char *srcprefix) { diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index fdba042..b6808da 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -38,7 +38,7 @@ #define VIR_FROM_THIS VIR_FROM_LXC -#if HAVE_FUSE +#if WITH_FUSE static const char *fuse_meminfo_path = "/meminfo"; diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h index 93964a4..ccc9b92 100644 --- a/src/lxc/lxc_fuse.h +++ b/src/lxc/lxc_fuse.h @@ -27,7 +27,7 @@ # define FUSE_USE_VERSION 26 # include <config.h> -# if HAVE_FUSE +# if WITH_FUSE # include <fuse.h> # endif -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 4 ++-- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_fuse.c | 2 +- src/lxc/lxc_fuse.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 33 ++------------------------------- m4/virt-fuse.m4 | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 m4/virt-fuse.m4 diff --git a/configure.ac b/configure.ac index 313b6dc..d7b6810 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" LIBSSH2_REQUIRED="1.0" LIBSSH2_TRANSPORT_REQUIRED="1.3" -FUSE_REQUIRED="2.8.6" dnl Checks for C compiler. AC_PROG_CC @@ -154,6 +153,7 @@ LIBVIRT_CHECK_AVAHI LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_DBUS +LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_HAL LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL @@ -1426,31 +1426,6 @@ AM_CONDITIONAL([HAVE_LIBSSH2], [test "$with_libssh2_transport" = "yes"]) AC_SUBST([LIBSSH2_CFLAGS]) AC_SUBST([LIBSSH2_LIBS]) - -dnl libfuse -AC_ARG_WITH([fuse], - AC_HELP_STRING([--with-fuse], [use libfuse to proivde fuse filesystem support for libvirt lxc]), - [], - [with_fuse=check]) -dnl -dnl This check looks for 'fuse' -dnl -AS_IF([test "x$with_fuse" != "xno"], - [PKG_CHECK_MODULES([FUSE], [fuse >= $FUSE_REQUIRED], - [with_fuse=yes - AC_SUBST([FUSE_CFLAGS]) - AC_SUBST([FUSE_LIBS]) - AC_DEFINE_UNQUOTED([WITH_FUSE], 1, [whether fuse is available for libvirt lxc]) - ], - [if test "x$with_fuse" = "xyes" ; then - AC_MSG_ERROR([You must install fuse library to compile libvirt]) - else - with_fuse=no - fi - ]) - ]) -AM_CONDITIONAL([WITH_FUSE], [test "x$with_fuse" = "xyes"]) - dnl virsh libraries AC_CHECK_HEADERS([readline/readline.h]) @@ -2561,6 +2536,7 @@ LIBVIRT_RESULT_AVAHI LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_DBUS +LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_HAL LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL @@ -2602,11 +2578,6 @@ fi else AC_MSG_NOTICE([ polkit: no]) fi -if test "$with_fuse" = "yes" ; then -AC_MSG_NOTICE([ fuse: $FUSE_CFLAGS $FUSE_LIBS]) -else -AC_MSG_NOTICE([ fuse: no]) -fi if test "$with_xen" = "yes" ; then AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS]) else diff --git a/m4/virt-fuse.m4 b/m4/virt-fuse.m4 new file mode 100644 index 0000000..b6c95c8 --- /dev/null +++ b/m4/virt-fuse.m4 @@ -0,0 +1,27 @@ +dnl The libfuse.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_FUSE],[ + LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6]) +]) + +AC_DEFUN([LIBVIRT_RESULT_FUSE],[ + LIBVIRT_RESULT_LIB([FUSE]) +]) + -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 33 ++------------------------------- m4/virt-fuse.m4 | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 31 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 4 ++-- src/libvirt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d7b6810..a1c80c1 100644 --- a/configure.ac +++ b/configure.ac @@ -1871,9 +1871,9 @@ if test "$with_esx" = "yes" || test "$with_esx" = "check" || test "$with_xenapi" fi if test "$have_curl" = "yes" ; then - AC_DEFINE_UNQUOTED([HAVE_LIBCURL], 1, [whether libcurl is available]) + AC_DEFINE_UNQUOTED([WITH_CURL], 1, [whether libcurl is available]) fi -AM_CONDITIONAL([HAVE_LIBCURL], [test "$have_curl" = "yes"]) +AM_CONDITIONAL([WITH_CURL], [test "$have_curl" = "yes"]) if test "$with_esx" = "yes" ; then diff --git a/src/libvirt.c b/src/libvirt.c index 1490738..7db677f 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -41,7 +41,7 @@ # include <winsock2.h> #endif -#ifdef HAVE_LIBCURL +#ifdef WITH_CURL # include <curl/curl.h> #endif @@ -419,7 +419,7 @@ virGlobalInit(void) virNetTLSInit(); #endif -#if HAVE_LIBCURL +#if WITH_CURL curl_global_init(CURL_GLOBAL_DEFAULT); #endif -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 4 ++-- src/libvirt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 71 ++++++++++++++++++++------------------------------------- m4/virt-curl.m4 | 27 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 46 deletions(-) create mode 100644 m4/virt-curl.m4 diff --git a/configure.ac b/configure.ac index a1c80c1..85444cf 100644 --- a/configure.ac +++ b/configure.ac @@ -102,7 +102,6 @@ POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" XMLRPC_REQUIRED=1.14.0 DEVMAPPER_REQUIRED=1.0.0 -LIBCURL_REQUIRED="7.18.0" OPENWSMAN_REQUIRED="2.2.3" LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" @@ -152,6 +151,7 @@ LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_AVAHI LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG +LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_HAL @@ -703,21 +703,30 @@ if test "$with_xenapi" != "no" ; then CFLAGS="$CFLAGS $LIBXENSERVER_CFLAGS" LIBS="$LIBS $LIBXENSERVER_LIBS" AC_CHECK_LIB([xenserver], [xen_vm_start], [ - with_xenapi=yes LIBXENSERVER_LIBS="$LIBXENSERVER_LIBS -lxenserver" ],[ if test "$with_xenapi" = "yes"; then fail=1 fi - with_xenapi=no + with_xenapi=no ]) + if test "$with_xenapi" != "no" ; then + if test "$with_curl" = "no"; then + if test "$with_xenapi" = "yes"; then + fail=1 + fi + with_xenapi=no + else + with_xenapi=yes + fi + fi fi LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" if test $fail = 1; then - AC_MSG_ERROR([You must install the XenServer Library to compile XenAPI driver with -lxenserver]) + AC_MSG_ERROR([You must install libxenerver and libcurl to compile the XenAPI driver]) fi if test "$with_xenapi" = "yes"; then @@ -1835,46 +1844,20 @@ fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) dnl -dnl check for libcurl (ESX/XenAPI) +dnl check for (ESX) dnl -LIBCURL_CFLAGS="" -LIBCURL_LIBS="" -have_curl=no - -if test "$with_esx" = "yes" || test "$with_esx" = "check" || test "$with_xenapi" = "yes" || test "$with_xenapi" = "check"; then - PKG_CHECK_MODULES(LIBCURL, libcurl >= $LIBCURL_REQUIRED, [ - have_curl=yes - - if test "$with_esx" = "check"; then - with_esx=yes - fi - - if test "$with_xenapi" = "check"; then - with_xenapi=yes - fi - ], [ - if test "$with_esx" = "check"; then - with_esx=no - AC_MSG_NOTICE([libcurl is required for the ESX driver, disabling it]) - elif test "$with_esx" = "yes"; then - AC_MSG_ERROR([libcurl >= $LIBCURL_REQUIRED is required for the ESX driver]) - fi - - if test "$with_xenapi" = "check"; then - with_xenapi=no - AC_MSG_NOTICE([libcurl is required for the XenAPI driver, disabling it]) - elif test "$with_xenapi" = "yes"; then - AC_MSG_ERROR([libcurl >= $LIBCURL_REQUIRED is required for the XenAPI driver]) - fi - ]) -fi - -if test "$have_curl" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_CURL], 1, [whether libcurl is available]) +if test "$with_curl" != "yes" ; then + if test "$with_esx" = "check"; then + with_esx=no + else + AC_MSG_ERROR([Curl is required for the ESX driver]) + fi +else + if test "$with_esx" = "check"; then + with_esx=yes + fi fi -AM_CONDITIONAL([WITH_CURL], [test "$have_curl" = "yes"]) - if test "$with_esx" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_ESX], 1, [whether ESX driver is enabled]) @@ -2535,6 +2518,7 @@ LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_AVAHI LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG +LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_HAL @@ -2548,11 +2532,6 @@ LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) -if test "$have_curl" = "yes" ; then -AC_MSG_NOTICE([ libcurl: $LIBCURL_CFLAGS $LIBCURL_LIBS]) -else -AC_MSG_NOTICE([ libcurl: no]) -fi if test "$with_hyperv" = "yes" ; then AC_MSG_NOTICE([openwsman: $OPENWSMAN_CFLAGS $OPENWSMAN_LIBS]) else diff --git a/m4/virt-curl.m4 b/m4/virt-curl.m4 new file mode 100644 index 0000000..8a440bb --- /dev/null +++ b/m4/virt-curl.m4 @@ -0,0 +1,27 @@ +dnl The libcurl.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_CURL],[ + LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0]) +]) + +AC_DEFUN([LIBVIRT_RESULT_CURL],[ + LIBVIRT_RESULT_LIB([CURL]) +]) + -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 71 ++++++++++++++++++++------------------------------------- m4/virt-curl.m4 | 27 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 46 deletions(-) create mode 100644 m4/virt-curl.m4
if test $fail = 1; then - AC_MSG_ERROR([You must install the XenServer Library to compile XenAPI driver with -lxenserver]) + AC_MSG_ERROR([You must install libxenerver and libcurl to compile the XenAPI driver])
s/libxenerver/libxenserver/ ACK with that fix -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 4 ++-- src/Makefile.am | 4 ++-- src/rpc/virnetsocket.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 85444cf..6c413d8 100644 --- a/configure.ac +++ b/configure.ac @@ -1426,11 +1426,11 @@ if test "$with_phyp" = "yes"; then AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled]) fi if test "$with_libssh2_transport" = "yes"; then - AC_DEFINE_UNQUOTED([HAVE_LIBSSH2], 1, [whether libssh2 transport is enabled]) + AC_DEFINE_UNQUOTED([WITH_SSH2], 1, [whether libssh2 transport is enabled]) fi AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) -AM_CONDITIONAL([HAVE_LIBSSH2], [test "$with_libssh2_transport" = "yes"]) +AM_CONDITIONAL([WITH_SSH2], [test "$with_libssh2_transport" = "yes"]) AC_SUBST([LIBSSH2_CFLAGS]) AC_SUBST([LIBSSH2_LIBS]) diff --git a/src/Makefile.am b/src/Makefile.am index ede67e9..61944ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1426,7 +1426,7 @@ if WITH_SASL USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms endif -if HAVE_LIBSSH2 +if WITH_SSH2 USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms endif @@ -1772,7 +1772,7 @@ libvirt_net_rpc_la_SOURCES = \ rpc/virnetsocket.h rpc/virnetsocket.c \ rpc/virkeepaliveprotocol.h rpc/virkeepaliveprotocol.c \ rpc/virkeepalive.h rpc/virkeepalive.c -if HAVE_LIBSSH2 +if WITH_SSH2 libvirt_net_rpc_la_SOURCES += \ rpc/virnetsshsession.h rpc/virnetsshsession.c else diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 7364482..5f97d6e 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -51,7 +51,7 @@ #include "passfd.h" -#if HAVE_LIBSSH2 +#if WITH_SSH2 # include "virnetsshsession.h" #endif @@ -93,7 +93,7 @@ struct _virNetSocket { size_t saslEncodedLength; size_t saslEncodedOffset; #endif -#if HAVE_LIBSSH2 +#if WITH_SSH2 virNetSSHSessionPtr sshSession; #endif }; @@ -738,7 +738,7 @@ int virNetSocketNewConnectSSH(const char *nodename, return virNetSocketNewConnectCommand(cmd, retsock); } -#if HAVE_LIBSSH2 +#if WITH_SSH2 int virNetSocketNewConnectLibSSH2(const char *host, const char *port, @@ -870,7 +870,7 @@ virNetSocketNewConnectLibSSH2(const char *host ATTRIBUTE_UNUSED, _("libssh2 transport support was not enabled")); return -1; } -#endif /* HAVE_LIBSSH2 */ +#endif /* WITH_SSH2 */ int virNetSocketNewConnectExternal(const char **cmdargv, virNetSocketPtr *retsock) @@ -1025,7 +1025,7 @@ void virNetSocketDispose(void *obj) virObjectUnref(sock->saslSession); #endif -#if HAVE_LIBSSH2 +#if WITH_SSH2 virObjectUnref(sock->sshSession); #endif @@ -1234,7 +1234,7 @@ bool virNetSocketHasCachedData(virNetSocketPtr sock ATTRIBUTE_UNUSED) bool hasCached = false; virMutexLock(&sock->lock); -#if HAVE_LIBSSH2 +#if WITH_SSH2 if (virNetSSHSessionHasCachedData(sock->sshSession)) hasCached = true; #endif @@ -1247,7 +1247,7 @@ bool virNetSocketHasCachedData(virNetSocketPtr sock ATTRIBUTE_UNUSED) return hasCached; } -#if HAVE_LIBSSH2 +#if WITH_SSH2 static ssize_t virNetSocketLibSSH2Read(virNetSocketPtr sock, char *buf, size_t len) @@ -1281,7 +1281,7 @@ static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len) char *errout = NULL; ssize_t ret; -#if HAVE_LIBSSH2 +#if WITH_SSH2 if (sock->sshSession) return virNetSocketLibSSH2Read(sock, buf, len); #endif @@ -1340,7 +1340,7 @@ static ssize_t virNetSocketWriteWire(virNetSocketPtr sock, const char *buf, size { ssize_t ret; -#if HAVE_LIBSSH2 +#if WITH_SSH2 if (sock->sshSession) return virNetSocketLibSSH2Write(sock, buf, len); #endif -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 4 ++-- src/Makefile.am | 4 ++-- src/rpc/virnetsocket.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> This converts the libssh2 configure check to use LIBVIRT_CHECK_PKG. Previously it would check version 1.0 and 1.3, but this simplifies things to just require version 1.3 --- configure.ac | 70 +++++++++++---------------------------------------------- libvirt.spec.in | 13 +++-------- m4/virt-ssh2.m4 | 27 ++++++++++++++++++++++ src/Makefile.am | 8 +++---- 4 files changed, 47 insertions(+), 71 deletions(-) create mode 100644 m4/virt-ssh2.m4 diff --git a/configure.ac b/configure.ac index 6c413d8..e8ccdb5 100644 --- a/configure.ac +++ b/configure.ac @@ -105,8 +105,6 @@ DEVMAPPER_REQUIRED=1.0.0 OPENWSMAN_REQUIRED="2.2.3" LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" -LIBSSH2_REQUIRED="1.0" -LIBSSH2_TRANSPORT_REQUIRED="1.3" dnl Checks for C compiler. AC_PROG_CC @@ -161,6 +159,7 @@ LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX +LIBVIRT_CHECK_SSH2 LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_YAJL @@ -415,8 +414,6 @@ AC_ARG_WITH([openvz], AC_HELP_STRING([--with-openvz], [add OpenVZ support @<:@default=check@:>@]),[],[with_openvz=check]) AC_ARG_WITH([vmware], AC_HELP_STRING([--with-vmware], [add VMware support @<:@default=yes@:>@]),[],[with_vmware=yes]) -AC_ARG_WITH([libssh2], - AC_HELP_STRING([--with-libssh2], [libssh2 location @<:@default=check@:>@]),[],[with_libssh2=check]) AC_ARG_WITH([phyp], AC_HELP_STRING([--with-phyp], [add PHYP support @<:@default=check@:>@]),[],[with_phyp=check]) AC_ARG_WITH([xenapi], @@ -447,8 +444,6 @@ AC_ARG_WITH([chrdev-lock-files], (use auto for default paths on some platforms) @<:@default=auto@:>@]), [],[with_chrdev_lock_files=auto]) -AC_ARG_WITH([libssh2_transport], - AC_HELP_STRING([--with-libssh2_transport], [libssh2 location @<:@default=check@:>@]),[],[with_libssh2_transport=check]) dnl dnl in case someone want to build static binaries @@ -1379,61 +1374,26 @@ AM_CONDITIONAL([WITH_UML], [test "$with_uml" = "yes"]) dnl -dnl check for libssh2 (PHYP and libssh2 transport) +dnl check for PHYP dnl -LIBSSH2_CFLAGS="" -LIBSSH2_LIBS="" - -if test "$with_phyp" = "yes" || test "$with_phyp" = "check" || - test "$with_libssh2_transport" = "yes" || test "$with_libssh2_transport" = "check"; then - PKG_CHECK_MODULES([LIBSSH2], [libssh2 >= $LIBSSH2_REQUIRED], [ - if test "$with_phyp" = "check"; then - with_phyp=yes - fi - if $PKG_CONFIG "libssh2 >= $LIBSSH2_TRANSPORT_REQUIRED"; then - if test "$with_libssh2_transport" = "check"; then - with_libssh2_transport=yes - fi - else - if test "$with_libssh2_transport" = "check"; then - with_libssh2_transport=no - AC_MSG_NOTICE([libssh2 >= $LIBSSH2_TRANSPORT_REQUIRED is required for libssh2 transport]) - fi - if test "$with_libssh2_transport" = "yes"; then - AC_MSG_ERROR([libssh2 >= $LIBSSH2_TRANSPORT_REQUIRED is required for libssh2 transport]) - fi - fi - ], [ - if test "$with_phyp" = "check"; then - with_phyp=no - AC_MSG_NOTICE([libssh2 is required for Phyp driver, disabling it]) - fi - if test "$with_phyp" = "yes"; then - AC_MSG_ERROR([libssh2 >= $LIBSSH2_REQUIRED is required for Phyp driver]) - fi - if test "$with_libssh2_transport" = "check"; then - with_libssh2_transport=no - AC_MSG_NOTICE([libssh2 >= $LIBSSH2_TRANSPORT_REQUIRED is required for libssh2 transport]) - fi - if test "$with_libssh2_transport" = "yes"; then - AC_MSG_ERROR([libssh2 >= $LIBSSH2_TRANSPORT_REQUIRED is required for libssh2 transport]) - fi - ]) +if test "$with_phyp" != "no"; then + if test "$with_ssh2" = "no" ; then + if test "$with_phyp" = "check"; then + with_phyp=no + else + AC_MSG_ERROR([libssh2 is required for Phyp driver]) + fi + else + with_phyp=yes + fi fi if test "$with_phyp" = "yes"; then AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled]) fi -if test "$with_libssh2_transport" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_SSH2], 1, [whether libssh2 transport is enabled]) -fi AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"]) -AM_CONDITIONAL([WITH_SSH2], [test "$with_libssh2_transport" = "yes"]) - -AC_SUBST([LIBSSH2_CFLAGS]) -AC_SUBST([LIBSSH2_LIBS]) dnl virsh libraries AC_CHECK_HEADERS([readline/readline.h]) @@ -2528,6 +2488,7 @@ LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX +LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) @@ -2537,11 +2498,6 @@ AC_MSG_NOTICE([openwsman: $OPENWSMAN_CFLAGS $OPENWSMAN_LIBS]) else AC_MSG_NOTICE([openwsman: no]) fi -if test "$with_libssh2" != "no" ; then -AC_MSG_NOTICE([ libssh2: $LIBSSH2_CFLAGS $LIBSSH2_LIBS]) -else -AC_MSG_NOTICE([ libssh2: no]) -fi if test "$with_gnutls" != "no" ; then AC_MSG_NOTICE([ gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS]) else diff --git a/libvirt.spec.in b/libvirt.spec.in index 246d889..35869a8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -115,7 +115,7 @@ %define with_systemd 0%{!?_without_systemd:0} %define with_numad 0%{!?_without_numad:0} %define with_firewalld 0%{!?_without_firewalld:0} -%define with_libssh2_transport 0%{!?_without_libssh2_transport:0} +%define with_libssh2 0%{!?_without_libssh2:0} # Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -244,7 +244,7 @@ # Enable libssh2 transport for new enough distros %if 0%{?fedora} >= 17 || 0%{?rhel} >= 6 -%define with_libssh2_transport 0%{!?_without_libssh2_transport:1} +%define with_libssh2 0%{!?_without_libssh2:1} %endif # Disable some drivers when building without libvirt daemon. @@ -525,12 +525,8 @@ BuildRequires: libcap-ng-devel >= 0.5.0 %if %{with_fuse} BuildRequires: fuse-devel >= 2.8.6 %endif -%if %{with_phyp} || %{with_libssh2_transport} -%if %{with_libssh2_transport} +%if %{with_phyp} || %{with_libssh2} BuildRequires: libssh2-devel >= 1.3.0 -%else -BuildRequires: libssh2-devel -%endif %endif %if %{with_netcf} @@ -1032,9 +1028,6 @@ Requires: cyrus-sasl # work correctly & doesn't have onerous dependencies Requires: cyrus-sasl-md5 %endif -%if %{with_libssh2_transport} -Requires: libssh2 >= 1.3.0 -%endif %description client Shared libraries and client binaries needed to access to the diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4 new file mode 100644 index 0000000..219bf5e --- /dev/null +++ b/m4/virt-ssh2.m4 @@ -0,0 +1,27 @@ +dnl The libssh2.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_SSH2],[ + LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3]) +]) + +AC_DEFUN([LIBVIRT_RESULT_SSH2],[ + LIBVIRT_RESULT_LIB([SSH2]) +]) + diff --git a/src/Makefile.am b/src/Makefile.am index 61944ae..976d5c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -848,8 +848,8 @@ endif if WITH_PHYP noinst_LTLIBRARIES += libvirt_driver_phyp.la libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la -libvirt_driver_phyp_la_LIBADD = $(LIBSSH2_LIBS) -libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS) \ +libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS) +libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES) endif @@ -1796,13 +1796,13 @@ endif libvirt_net_rpc_la_CFLAGS = \ $(GNUTLS_CFLAGS) \ $(SASL_CFLAGS) \ - $(LIBSSH2_CFLAGS) \ + $(SSH2_CFLAGS) \ $(XDR_CFLAGS) \ $(AM_CFLAGS) libvirt_net_rpc_la_LDFLAGS = \ $(GNUTLS_LIBS) \ $(SASL_LIBS) \ - $(LIBSSH2_LIBS)\ + $(SSH2_LIBS)\ $(AM_LDFLAGS) \ $(CYGWIN_EXTRA_LDFLAGS) \ $(MINGW_EXTRA_LDFLAGS) -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
This converts the libssh2 configure check to use LIBVIRT_CHECK_PKG. Previously it would check version 1.0 and 1.3, but this simplifies things to just require version 1.3
Are we sure we want to do that? Previously, with libssh2 1.0, it was possible to build phyp but not qemu+libssh:///; with this change, building phyp now requires libssh2 1.3. Then again, RHEL 5 only ships with libssh2-0.18, so we already have platforms where we can't even support phyp. Furthermore, we haven't had a very active phyp maintainer (most phyp patches in the past year have been global maintenance cleanups, not actual development), so if this situation actually impacts someone, maybe it will convince them to speak up. In the meantime, trying to maintain libssh2 1.0 for phyp but not for the rest of the code base is too prone to bitrot issues. I've convinced myself - if phyp development were more active, then it might be up for debate; but given the current situation, the change is worthwhile as-is. ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 31 +++++++++++++------------------ m4/virt-openwsman.m4 | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 m4/virt-openwsman.m4 diff --git a/configure.ac b/configure.ac index e8ccdb5..9b31ca8 100644 --- a/configure.ac +++ b/configure.ac @@ -102,7 +102,6 @@ POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" XMLRPC_REQUIRED=1.14.0 DEVMAPPER_REQUIRED=1.0.0 -OPENWSMAN_REQUIRED="2.2.3" LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" @@ -155,6 +154,7 @@ LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_HAL LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NUMACTL +LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -1850,25 +1850,19 @@ AC_SUBST([LIBCURL_LIBS]) dnl -dnl check for openwsman (Hyper-V) +dnl check for Hyper-V dnl -OPENWSMAN_CFLAGS="" -OPENWSMAN_LIBS="" - -if test "$with_hyperv" = "yes" || test "$with_hyperv" = "check"; then - PKG_CHECK_MODULES([OPENWSMAN], [openwsman >= $OPENWSMAN_REQUIRED], [ - if test "$with_hyperv" = "check"; then - with_hyperv=yes - fi - ], [ - if test "$with_hyperv" = "check"; then - with_hyperv=no - AC_MSG_NOTICE([openwsman is required for the Hyper-V driver, disabling it]) - elif test "$with_hyperv" = "yes"; then - AC_MSG_ERROR([openwsman >= $OPENWSMAN_REQUIRED is required for the Hyper-V driver]) - fi - ]) +if test "$with_hyperv" != "no"; then + if test "$with_openwsman" != "yes"; then + if test "$with_hyperv" = "check"; then + with_hyperv=no + else + AC_MSG_ERROR([openwsman is required for the Hyper-V driver]) + fi + else + with_hyperv=yes + fi fi if test "$with_hyperv" = "yes" ; then @@ -2484,6 +2478,7 @@ LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_HAL LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NUMACTL +LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4 new file mode 100644 index 0000000..0f48b0f --- /dev/null +++ b/m4/virt-openwsman.m4 @@ -0,0 +1,27 @@ +dnl The libopenwsman.so library +dnl +dnl Copyright (C) 2012-2013 Red Hat, Inc. +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library. If not, see +dnl <http://www.gnu.org/licenses/>. +dnl + +AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[ + LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3]) +]) + +AC_DEFUN([LIBVIRT_RESULT_OPENWSMAN],[ + LIBVIRT_RESULT_LIB([OPENWSMAN]) +]) + -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 31 +++++++++++++------------------ m4/virt-openwsman.m4 | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 m4/virt-openwsman.m4
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9b31ca8..a82c75d 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,6 @@ LIBXML_REQUIRED="2.6.0" GNUTLS_REQUIRED="1.0.25" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" -XMLRPC_REQUIRED=1.14.0 DEVMAPPER_REQUIRED=1.0.0 LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1" -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 1 - 1 file changed, 1 deletion(-)
diff --git a/configure.ac b/configure.ac index 9b31ca8..a82c75d 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,6 @@ LIBXML_REQUIRED="2.6.0" GNUTLS_REQUIRED="1.0.25" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" -XMLRPC_REQUIRED=1.14.0 DEVMAPPER_REQUIRED=1.0.0 LIBPCAP_REQUIRED="1.0.0" LIBNL_REQUIRED="1.1"
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> --- configure.ac | 14 +++++++------- daemon/Makefile.am | 6 +++--- daemon/libvirtd-config.c | 6 +++--- daemon/remote.c | 10 +++++----- src/remote/remote_driver.c | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index a82c75d..ff53b96 100644 --- a/configure.ac +++ b/configure.ac @@ -1113,9 +1113,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH]) if test "x$PKCHECK_PATH" != "x" ; then AC_DEFINE_UNQUOTED([PKCHECK_PATH],["$PKCHECK_PATH"],[Location of pkcheck program]) - AC_DEFINE_UNQUOTED([HAVE_POLKIT], 1, + AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, [use PolicyKit for UNIX socket access checks]) - AC_DEFINE_UNQUOTED([HAVE_POLKIT1], 1, + AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1, [use PolicyKit for UNIX socket access checks]) with_polkit="yes" with_polkit1="yes" @@ -1131,9 +1131,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then fi ]) if test "x$with_polkit" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_POLKIT], 1, + AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, [use PolicyKit for UNIX socket access checks]) - AC_DEFINE_UNQUOTED([HAVE_POLKIT0], 1, + AC_DEFINE_UNQUOTED([WITH_POLKIT0], 1, [use PolicyKit for UNIX socket access checks]) old_CFLAGS=$CFLAGS @@ -1152,9 +1152,9 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then fi fi fi -AM_CONDITIONAL([HAVE_POLKIT], [test "x$with_polkit" = "xyes"]) -AM_CONDITIONAL([HAVE_POLKIT0], [test "x$with_polkit0" = "xyes"]) -AM_CONDITIONAL([HAVE_POLKIT1], [test "x$with_polkit1" = "xyes"]) +AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"]) +AM_CONDITIONAL([WITH_POLKIT0], [test "x$with_polkit0" = "xyes"]) +AM_CONDITIONAL([WITH_POLKIT1], [test "x$with_polkit1" = "xyes"]) AC_SUBST([POLKIT_CFLAGS]) AC_SUBST([POLKIT_LIBS]) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index c4faa11..f257272 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -170,8 +170,8 @@ endif libvirtd_LDADD += ../src/libvirt.la -if HAVE_POLKIT -if HAVE_POLKIT0 +if WITH_POLKIT +if WITH_POLKIT0 policydir = $(datadir)/PolicyKit/policy policyauth = auth_admin_keep_session else @@ -201,7 +201,7 @@ uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-up rmdir $(DESTDIR)$(localstatedir)/run/libvirt || : rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || : -if HAVE_POLKIT +if WITH_POLKIT install-data-polkit:: $(MKDIR_P) $(DESTDIR)$(policydir) $(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c index fe9fc10..5e3ae21 100644 --- a/daemon/libvirtd-config.c +++ b/daemon/libvirtd-config.c @@ -242,7 +242,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED) goto no_memory; /* Only default to PolicyKit if running as root */ -#if HAVE_POLKIT +#if WITH_POLKIT if (privileged) { data->auth_unix_rw = REMOTE_AUTH_POLKIT; data->auth_unix_ro = REMOTE_AUTH_POLKIT; @@ -250,7 +250,7 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED) #endif data->auth_unix_rw = REMOTE_AUTH_NONE; data->auth_unix_ro = REMOTE_AUTH_NONE; -#if HAVE_POLKIT +#if WITH_POLKIT } #endif @@ -374,7 +374,7 @@ daemonConfigLoadOptions(struct daemonConfig *data, if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0) goto error; -#if HAVE_POLKIT +#if WITH_POLKIT /* Change default perms to be wide-open if PolicyKit is enabled. * Admin can always override in config file */ diff --git a/daemon/remote.c b/daemon/remote.c index 7b1f8eb..6cdfcd8 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -24,7 +24,7 @@ #include "virerror.h" -#if HAVE_POLKIT0 +#if WITH_POLKIT0 # include <polkit/polkit.h> # include <polkit-dbus/polkit-dbus.h> #endif @@ -2802,7 +2802,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server ATTRIBUTE_UNUSED, -#if HAVE_POLKIT1 +#if WITH_POLKIT1 static int remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED, virNetServerClientPtr client, @@ -2912,7 +2912,7 @@ authdeny: client, REMOTE_AUTH_POLKIT, ident); goto error; } -#elif HAVE_POLKIT0 +#elif WITH_POLKIT0 static int remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED, virNetServerClientPtr client, @@ -3056,7 +3056,7 @@ authdeny: goto error; } -#else /* !HAVE_POLKIT0 & !HAVE_POLKIT1*/ +#else /* !WITH_POLKIT0 & !HAVE_POLKIT1*/ static int remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED, @@ -3071,7 +3071,7 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED, virNetMessageSaveError(rerr); return -1; } -#endif /* HAVE_POLKIT1 */ +#endif /* WITH_POLKIT1 */ /*************************************************************** diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index dcb06c9..916ded5 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -122,10 +122,10 @@ static int remoteAuthenticate(virConnectPtr conn, struct private_data *priv, static int remoteAuthSASL(virConnectPtr conn, struct private_data *priv, virConnectAuthPtr auth, const char *mech); #endif -#if HAVE_POLKIT +#if WITH_POLKIT static int remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, virConnectAuthPtr auth); -#endif /* HAVE_POLKIT */ +#endif /* WITH_POLKIT */ static virDomainPtr get_nonnull_domain(virConnectPtr conn, remote_nonnull_domain domain); static virNetworkPtr get_nonnull_network(virConnectPtr conn, remote_nonnull_network network); @@ -3504,7 +3504,7 @@ remoteAuthenticate(virConnectPtr conn, struct private_data *priv, } #endif -#if HAVE_POLKIT +#if WITH_POLKIT case REMOTE_AUTH_POLKIT: if (remoteAuthPolkit(conn, priv, auth) < 0) { VIR_FREE(ret.types.types_val); @@ -4075,8 +4075,8 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, #endif /* WITH_SASL */ -#if HAVE_POLKIT -# if HAVE_POLKIT1 +#if WITH_POLKIT +# if WITH_POLKIT1 static int remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, virConnectAuthPtr auth ATTRIBUTE_UNUSED) @@ -4094,7 +4094,7 @@ remoteAuthPolkit(virConnectPtr conn, struct private_data *priv, VIR_DEBUG("PolicyKit-1 authentication complete"); return 0; } -# elif HAVE_POLKIT0 +# elif WITH_POLKIT0 /* Perform the PolicyKit authentication process */ static int @@ -4156,8 +4156,8 @@ out: VIR_DEBUG("PolicyKit-0 authentication complete"); return 0; } -# endif /* HAVE_POLKIT0 */ -#endif /* HAVE_POLKIT */ +# endif /* WITH_POLKIT0 */ +#endif /* WITH_POLKIT */ /*----------------------------------------------------------------------*/ static int remoteDomainEventRegister(virConnectPtr conn, -- 1.7.11.7

On 01/11/2013 04:06 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
--- configure.ac | 14 +++++++------- daemon/Makefile.am | 6 +++--- daemon/libvirtd-config.c | 6 +++--- daemon/remote.c | 10 +++++----- src/remote/remote_driver.c | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake