[libvirt] [PATCH 0/4] first part of configure cleanup and one bug fix

Pavel Hrdina (4): configure: cleanup openwsman leftovers configure: remove check for CPUID m4/virt-lib: properly pass header_name in LIBVIRT_CHECK_LIB(_ALT) configure: sort libvirt macros configure.ac | 32 ++++---------------------------- m4/virt-lib.m4 | 6 +++--- src/cpu/cpu_x86.c | 4 ++-- 3 files changed, 9 insertions(+), 33 deletions(-) -- 2.11.0

Commit a99bfb4b moved openwsman to its onw file but forget to remove those few lines. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 5 ----- 1 file changed, 5 deletions(-) diff --git a/configure.ac b/configure.ac index 3802e5910c..6f04bdc1f6 100644 --- a/configure.ac +++ b/configure.ac @@ -2695,11 +2695,6 @@ LIBVIRT_RESULT_YAJL LIBVIRT_RESULT_GNUTLS AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) -if test "$with_hyperv" = "yes" ; then -AC_MSG_NOTICE([openwsman: $OPENWSMAN_CFLAGS $OPENWSMAN_LIBS]) -else -AC_MSG_NOTICE([openwsman: no]) -fi AC_MSG_NOTICE([firewalld: $with_firewalld]) if test "$with_polkit" = "yes" ; then if test "$with_polkit0" = "yes" ; then -- 2.11.0

On Wed, Dec 07, 2016 at 04:08:11PM +0100, Pavel Hrdina wrote:
Commit a99bfb4b moved openwsman to its onw file but forget to remove those few lines.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/configure.ac b/configure.ac index 3802e5910c..6f04bdc1f6 100644 --- a/configure.ac +++ b/configure.ac @@ -2695,11 +2695,6 @@ LIBVIRT_RESULT_YAJL LIBVIRT_RESULT_GNUTLS AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) -if test "$with_hyperv" = "yes" ; then -AC_MSG_NOTICE([openwsman: $OPENWSMAN_CFLAGS $OPENWSMAN_LIBS]) -else -AC_MSG_NOTICE([openwsman: no]) -fi AC_MSG_NOTICE([firewalld: $with_firewalld]) if test "$with_polkit" = "yes" ; then if test "$with_polkit0" = "yes" ; then
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

This check is not required because all i386 and x86_64 cpus have the cpuid instruction. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 19 ------------------- src/cpu/cpu_x86.c | 4 ++-- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 6f04bdc1f6..3b129e0207 100644 --- a/configure.ac +++ b/configure.ac @@ -265,25 +265,6 @@ LIBVIRT_CHECK_NSS LIBVIRT_CHECK_YAJL LIBVIRT_CHECK_GNUTLS -AC_MSG_CHECKING([for CPUID instruction]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[ - #include <stdint.h> - ]], - [[ - uint32_t eax, ebx, ecx, edx; - asm volatile ( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (eax)); - ]])], - [have_cpuid=yes], - [have_cpuid=no]) -if test "x$have_cpuid" = xyes; then - AC_DEFINE_UNQUOTED([HAVE_CPUID], 1, [whether CPUID instruction is supported]) -fi -AC_MSG_RESULT([$have_cpuid]) - AC_CHECK_SIZEOF([long]) dnl Availability of various common functions (non-fatal if missing), diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index c79308a715..23a519ec00 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2058,7 +2058,7 @@ x86Encode(virArch arch, } -#if HAVE_CPUID +#if defined(__i386__) || defined(__x86_64__) static inline void cpuidCall(virCPUx86CPUID *cpuid) { @@ -2740,7 +2740,7 @@ struct cpuArchDriver cpuDriverX86 = { .decode = x86DecodeCPUData, .encode = x86Encode, .free = x86FreeCPUData, -#if HAVE_CPUID +#if defined(__i386__) || defined(__x86_64__) .nodeData = x86NodeData, #else .nodeData = NULL, -- 2.11.0

On Wed, Dec 07, 2016 at 04:08:12PM +0100, Pavel Hrdina wrote:
This check is not required because all i386 and x86_64 cpus have the cpuid instruction.
Technically cpuid was only introduced in i486 cpus or later. Of course no one is going to be running libvirt on anything older than an i686, so for the real world we're fine with this simplification.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 19 ------------------- src/cpu/cpu_x86.c | 4 ++-- 2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/configure.ac b/configure.ac index 6f04bdc1f6..3b129e0207 100644 --- a/configure.ac +++ b/configure.ac @@ -265,25 +265,6 @@ LIBVIRT_CHECK_NSS LIBVIRT_CHECK_YAJL LIBVIRT_CHECK_GNUTLS
-AC_MSG_CHECKING([for CPUID instruction]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[ - #include <stdint.h> - ]], - [[ - uint32_t eax, ebx, ecx, edx; - asm volatile ( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (eax)); - ]])], - [have_cpuid=yes], - [have_cpuid=no]) -if test "x$have_cpuid" = xyes; then - AC_DEFINE_UNQUOTED([HAVE_CPUID], 1, [whether CPUID instruction is supported]) -fi -AC_MSG_RESULT([$have_cpuid]) - AC_CHECK_SIZEOF([long])
dnl Availability of various common functions (non-fatal if missing), diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index c79308a715..23a519ec00 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2058,7 +2058,7 @@ x86Encode(virArch arch, }
-#if HAVE_CPUID +#if defined(__i386__) || defined(__x86_64__) static inline void cpuidCall(virCPUx86CPUID *cpuid) { @@ -2740,7 +2740,7 @@ struct cpuArchDriver cpuDriverX86 = { .decode = x86DecodeCPUData, .encode = x86Encode, .free = x86FreeCPUData, -#if HAVE_CPUID +#if defined(__i386__) || defined(__x86_64__) .nodeData = x86NodeData, #else .nodeData = NULL,
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

The *header_name* cannot be quoted, otherwise it is not translated to the passed argument. Without this fix the generated configure contains *ac_cv_header_header_name*, but there should be for example *ac_cv_header_sals_sasl_h* for "sasl/sasl.h". Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 75b9b1dec1..a9efb74138 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -88,7 +88,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ with_var=no ]) if test "$fail" = "0" && test "x$with_var" != "xno" ; then - AC_CHECK_HEADER([header_name], [ + AC_CHECK_HEADER(header_name, [ with_var=yes ],[ if test "x$with_var" != "xcheck"; then @@ -225,10 +225,10 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ ]) ]) if test "$fail" = "0" && test "x$with_var" != "xno" ; then - AC_CHECK_HEADER([header_name], [ + AC_CHECK_HEADER(header_name, [ with_var=yes ],[ - AC_CHECK_HEADER([header_name_alt], [ + AC_CHECK_HEADER(header_name_alt, [ with_var=yes ],[ if test "x$with_var" != "xcheck"; then -- 2.11.0

On Wed, Dec 07, 2016 at 04:08:13PM +0100, Pavel Hrdina wrote:
The *header_name* cannot be quoted, otherwise it is not translated to the passed argument. Without this fix the generated configure contains *ac_cv_header_header_name*, but there should be for example *ac_cv_header_sals_sasl_h* for "sasl/sasl.h".
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-lib.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3b129e0207..d8802808b8 100644 --- a/configure.ac +++ b/configure.ac @@ -248,9 +248,11 @@ LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_GLUSTER +LIBVIRT_CHECK_GNUTLS LIBVIRT_CHECK_HAL LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_NETCF +LIBVIRT_CHECK_NSS LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS @@ -261,9 +263,7 @@ LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_SSH2 LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_WIRESHARK -LIBVIRT_CHECK_NSS LIBVIRT_CHECK_YAJL -LIBVIRT_CHECK_GNUTLS AC_CHECK_SIZEOF([long]) @@ -2658,9 +2658,11 @@ LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLUSTER +LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_NETCF +LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS @@ -2671,9 +2673,7 @@ LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_WIRESHARK -LIBVIRT_RESULT_NSS LIBVIRT_RESULT_YAJL -LIBVIRT_RESULT_GNUTLS AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS]) AC_MSG_NOTICE([ dlopen: $DLOPEN_LIBS]) AC_MSG_NOTICE([firewalld: $with_firewalld]) -- 2.11.0

On Wed, Dec 07, 2016 at 04:08:14PM +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

On Wed, Dec 07, 2016 at 03:15:16PM +0000, Daniel P. Berrange wrote:
On Wed, Dec 07, 2016 at 04:08:14PM +0100, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK
Thanks, all patches pushed. Pavel
participants (2)
-
Daniel P. Berrange
-
Pavel Hrdina