From patchwork Tue Jun 18 08:09:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanlong Gao X-Patchwork-Id: 252127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 88B622C0084 for ; Tue, 18 Jun 2013 18:14:56 +1000 (EST) Received: from localhost ([::1]:39323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uor42-0001S9-BT for incoming@patchwork.ozlabs.org; Tue, 18 Jun 2013 04:14:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uor1t-0006qt-6s for qemu-devel@nongnu.org; Tue, 18 Jun 2013 04:12:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uor1n-0001T8-U2 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 04:12:41 -0400 Received: from [222.73.24.84] (port=18122 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uor1n-0001Oz-Jw for qemu-devel@nongnu.org; Tue, 18 Jun 2013 04:12:35 -0400 X-IronPort-AV: E=Sophos;i="4.87,887,1363104000"; d="scan'208";a="7587532" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 18 Jun 2013 16:09:11 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r5I8C2BP003325; Tue, 18 Jun 2013 16:12:02 +0800 Received: from G08FNSTD121251.fnst.cn.fujitsu.com ([10.167.233.84]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013061816095974-2230901 ; Tue, 18 Jun 2013 16:09:59 +0800 From: Wanlong Gao To: qemu-devel@nongnu.org Date: Tue, 18 Jun 2013 16:09:46 +0800 Message-Id: <1371542991-15911-3-git-send-email-gaowanlong@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.rc2.10.g0c2b1cf In-Reply-To: <1371542991-15911-1-git-send-email-gaowanlong@cn.fujitsu.com> References: <1371542991-15911-1-git-send-email-gaowanlong@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/18 16:09:59, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/06/18 16:10:02, Serialize complete at 2013/06/18 16:10:02 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: andre.przywara@amd.com, aliguori@us.ibm.com, ehabkost@redhat.com, pbonzini@redhat.com, y-goto@jp.fujitsu.com, afaerber@suse.de, gaowanlong@cn.fujitsu.com Subject: [Qemu-devel] [PATCH 2/7] Add Linux libnuma detection X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Signed-off-by: Wanlong Gao --- 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 +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