qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, ehabkost@redhat.com, bsd@redhat.com,
	pbonzini@redhat.com, y-goto@jp.fujitsu.com, afaerber@suse.de,
	gaowanlong@cn.fujitsu.com
Subject: [Qemu-devel] [PATCH V3 03/10] NUMA: Add Linux libnuma detection
Date: Mon, 24 Jun 2013 15:12:01 +0800	[thread overview]
Message-ID: <1372057928-20248-4-git-send-email-gaowanlong@cn.fujitsu.com> (raw)
In-Reply-To: <1372057928-20248-1-git-send-email-gaowanlong@cn.fujitsu.com>

Add detection of libnuma (mostly contained in the numactl package)
to the configure script. Can be enabled or disabled on the command line,
default is use if available.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
 configure | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/configure b/configure
index ad32f87..2d2b177 100755
--- a/configure
+++ b/configure
@@ -242,6 +242,7 @@ gtk=""
 gtkabi="2.0"
 tpm="no"
 libssh2=""
+numa=""
 
 # parse CC options first
 for opt do
@@ -944,6 +945,10 @@ for opt do
   ;;
   --enable-libssh2) libssh2="yes"
   ;;
+  --disable-numa) numa="no"
+  ;;
+  --enable-numa) numa="yes"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -1158,6 +1163,8 @@ echo "  --gcov=GCOV              use specified gcov [$gcov_tool]"
 echo "  --enable-tpm             enable TPM support"
 echo "  --disable-libssh2        disable ssh block device support"
 echo "  --enable-libssh2         enable ssh block device support"
+echo "  --disable-numa           disable libnuma support"
+echo "  --enable-numa            enable libnuma support"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -2389,6 +2396,27 @@ EOF
 fi
 
 ##########################################
+# libnuma probe
+
+if test "$numa" != "no" ; then
+  numa=no
+  cat > $TMPC << EOF
+#include <numa.h>
+int main(void) { return numa_available(); }
+EOF
+
+  if compile_prog "" "-lnuma" ; then
+    numa=yes
+    libs_softmmu="-lnuma $libs_softmmu"
+  else
+    if test "$numa" = "yes" ; then
+      feature_not_found "linux NUMA (install numactl?)"
+    fi
+    numa=no
+  fi
+fi
+
+##########################################
 # linux-aio probe
 
 if test "$linux_aio" != "no" ; then
@@ -3556,6 +3584,7 @@ echo "TPM support       $tpm"
 echo "libssh2 support   $libssh2"
 echo "TPM passthrough   $tpm_passthrough"
 echo "QOM debugging     $qom_cast_debug"
+echo "NUMA host support $numa"
 
 if test "$sdl_too_old" = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -3589,6 +3618,9 @@ echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak
 echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
 echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
 echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
+if test "$numa" = "yes"; then
+  echo "CONFIG_NUMA=y" >> $config_host_mak
+fi
 
 echo "ARCH=$ARCH" >> $config_host_mak
 
-- 
1.8.3.1.448.gfb7dfaa

  parent reply	other threads:[~2013-06-24  7:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24  7:11 [Qemu-devel] [PATCH V3 00/10] Add support for binding guest numa nodes to host numa nodes Wanlong Gao
2013-06-24  7:11 ` [Qemu-devel] [PATCH V3 01/10] NUMA: Support multiple CPU ranges on -numa option Wanlong Gao
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 02/10] NUMA: Add numa_info structure to contain numa nodes info Wanlong Gao
2013-06-24  7:12 ` Wanlong Gao [this message]
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 04/10] NUMA: parse guest numa nodes memory policy Wanlong Gao
2013-06-24 19:09   ` Bandan Das
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 05/10] NUMA: handle Error in cpus, mpol and hostnode parser Wanlong Gao
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 06/10] NUMA: split out the common range parser Wanlong Gao
2013-06-24 19:15   ` Bandan Das
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 07/10] NUMA: set guest numa nodes memory policy Wanlong Gao
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 08/10] NUMA: add qmp command set-mpol to set memory policy for NUMA node Wanlong Gao
2013-07-04  5:19   ` Andreas Färber
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 09/10] NUMA: add hmp command set-mpol Wanlong Gao
2013-06-24  7:12 ` [Qemu-devel] [PATCH V3 10/10] NUMA: show host memory policy info in info numa command Wanlong Gao
2013-07-04  0:57 ` [Qemu-devel] [PATCH V3 00/10] Add support for binding guest numa nodes to host numa nodes Wanlong Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372057928-20248-4-git-send-email-gaowanlong@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=bsd@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).