[libvirt] PATCH: Add NUMA info to QEMU driver

Jim Meyering jim at meyering.net
Tue May 20 16:42:17 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:
...
> These 2 configure changes are candidates for global cleanup - the same
> duplicate diagnostics & underquoting are present through-out

Yep.  Deferring it is fine, of course.
That's why I said this:

  [I hesitate to mention this, since there is so much existing
   code here that does it the same way, but eventually this may well
   bite someone, so best to start doing it right. ]

>  configure.in      |   39 +++++++++++++++++++++++++++++++
>  libvirt.spec.in   |    3 ++
>  src/Makefile.am   |    2 +
>  src/qemu_conf.c   |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu_driver.c |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 175 insertions(+)
>
> Dan
>
> diff -r f912d3498d1b configure.in
> --- a/configure.in	Tue May 20 10:49:20 2008 -0400
> +++ b/configure.in	Tue May 20 11:54:16 2008 -0400
> @@ -533,6 +533,40 @@
>  AM_CONDITIONAL(HAVE_SELINUX, [test "$with_selinux" != "no"])
>  AC_SUBST(SELINUX_CFLAGS)
>  AC_SUBST(SELINUX_LIBS)
> +
> +dnl NUMA lib
> +AC_ARG_WITH(numactl,
> +  [  --with-numactl         use numactl for host topology info],
> +  [],
> +  [with_numactl=check])
> +
> +NUMACTL_CFLAGS=
> +NUMACTL_LIBS=
> +if test "$with_qemu" = "yes" -a "$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
> +    AC_CHECK_HEADER([numa.h],[],
> +       [AC_MSG_ERROR([You must install the numactl development package in order to compile libvirt])])
> +    AC_CHECK_LIB(numa, numa_available,[],
> +       [AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])])
> +  fi

Does that mean you'd prefer to keep the slightly different diagnostics above?
Here's an alternative:

   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 libvirt])




More information about the libvir-list mailing list