]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add numad build option
authorPavel Hrdina <phrdina@redhat.com>
Wed, 1 Jul 2020 00:47:06 +0000 (02:47 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-numad.m4 [deleted file]
meson.build
meson_options.txt

index 5e3743c45e3c688e05b0428fe40f699c8aacee6c..072aedf13df64e386fadfd5b36178d84c31d2c2f 100644 (file)
@@ -96,12 +96,10 @@ dnl
 dnl Miscellaneous checks
 dnl
 
-LIBVIRT_ARG_NUMAD
 LIBVIRT_ARG_TLS_PRIORITY
 LIBVIRT_ARG_SYSCTL_CONFIG
 
 
-LIBVIRT_CHECK_NUMAD
 LIBVIRT_CHECK_TLS_PRIORITY
 LIBVIRT_CHECK_SYSCTL_CONFIG
 
@@ -170,6 +168,5 @@ LIBVIRT_WIN_RESULT_WINDRES
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Miscellaneous])
 AC_MSG_NOTICE([])
-LIBVIRT_RESULT_NUMAD
 LIBVIRT_RESULT_TLS_PRIORITY
 AC_MSG_NOTICE([])
diff --git a/m4/virt-numad.m4 b/m4/virt-numad.m4
deleted file mode 100644 (file)
index 378eba3..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-dnl The numad binary check
-dnl
-dnl Copyright (C) 2016 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_ARG_NUMAD], [
-  LIBVIRT_ARG_WITH([NUMAD], [use numad to manage CPU placement dynamically],
-                   [check])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_NUMAD], [
-  AC_REQUIRE([LIBVIRT_CHECK_NUMACTL])
-
-  if test "$with_numad" != "no" ; then
-    fail=0
-
-    AC_PATH_PROG([NUMAD], [numad], [], [$LIBVIRT_SBIN_PATH])
-
-    if test "$with_numad" = "check"; then
-      test "$with_numactl" = "yes" || fail=1
-      if test -z "$NUMAD" || test $fail = 1; then
-        with_numad="no"
-      else
-        with_numad="yes"
-      fi
-    else
-      test -z  "$NUMAD" &&
-        AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically])
-
-      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
-  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
-  AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"])
-])
-
-AC_DEFUN([LIBVIRT_RESULT_NUMAD], [
-  LIBVIRT_RESULT([numad], [$with_numad])
-])
index b73e3efef484639c08106dc201d8caa19f3661f1..e6ae835529a15ff73a771566aff8f19aab9904b1 100644 (file)
@@ -2166,6 +2166,16 @@ if not get_option('nss').disabled()
   endif
 endif
 
+if not get_option('numad').disabled() and numactl_dep.found()
+  numad_prog = find_program('numad', required: get_option('numad'), dirs: libvirt_sbin_path)
+  if numad_prog.found()
+    conf.set('HAVE_NUMAD', 1)
+    conf.set_quoted('NUMAD', numad_prog.path())
+  endif
+elif get_option('numad').enabled()
+  error('You must have numactl enabled for numad support.')
+endif
+
 
 # define top include directory
 
@@ -2296,6 +2306,7 @@ misc_summary = {
   'Use -Werror': cc_flags.contains('-Werror'),
   'Warning Flags': supported_cc_flags,
   'DTrace': conf.has('WITH_DTRACE_PROBES'),
+  'numad': conf.has('HAVE_NUMAD'),
   'Init script': init_script,
   'Char device locks': chrdev_lock_files,
   'Loader/NVRAM': loader_res,
index c66bfc37884000b99ebef1cbbb52d10592b4a427..0e536a61d3228d6dbe1ad5d2a15dd7a4b05db068 100644 (file)
@@ -98,3 +98,4 @@ option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'no
 option('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of <loader>:<nvram> paths. Both pairs and list items are separated by a colon.')
 option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell')
 option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses')
+option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically')