From patchwork Mon Jan 27 12:01:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 314373 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 96CE62C009F for ; Mon, 27 Jan 2014 23:03:34 +1100 (EST) Received: from localhost ([::1]:59088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7kuY-0002WV-9I for incoming@patchwork.ozlabs.org; Mon, 27 Jan 2014 07:03:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7ksg-00089X-V1 for qemu-devel@nongnu.org; Mon, 27 Jan 2014 07:01:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7ksX-000804-CO for qemu-devel@nongnu.org; Mon, 27 Jan 2014 07:01:34 -0500 Received: from smtp.citrix.com ([66.165.176.89]:8988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7ksX-0007zr-7a for qemu-devel@nongnu.org; Mon, 27 Jan 2014 07:01:25 -0500 X-IronPort-AV: E=Sophos;i="4.95,728,1384300800"; d="scan'208";a="96770436" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 27 Jan 2014 12:01:16 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Mon, 27 Jan 2014 07:01:16 -0500 Received: from dt47.uk.xensource.com ([10.80.229.47] helo=dt47.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1W7ksM-0000QC-SU; Mon, 27 Jan 2014 12:01:14 +0000 From: Wei Liu To: , Date: Mon, 27 Jan 2014 12:01:09 +0000 Message-ID: <1390824074-21006-2-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390824074-21006-1-git-send-email-wei.liu2@citrix.com> References: <1390824074-21006-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: anthony.perard@citrix.com, peter.maydell@linaro.org, pbonzini@redhat.com, stefano.stabellini@eu.citrix.com Subject: [Qemu-devel] [PATCH RFC V2 1/6] configure: factor out list of supported Xen/KVM targets 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 From: Paolo Bonzini Signed-off-by: Paolo Bonzini --- configure | 58 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/configure b/configure index 07b6be3..549b9cc 100755 --- a/configure +++ b/configure @@ -4372,6 +4372,32 @@ if test "$linux" = "yes" ; then fi fi +supported_kvm_target() { + test "$kvm" = "yes" || return 1 + test "$target_softmmu" = "yes" || return 1 + case "$target_name:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64 | \ + ppc:ppc | ppcemb:ppc | ppc64:ppc | \ + ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ + s390x:s390x) + return 0 + ;; + esac + return 1 +} + +supported_xen_target() { + test "$xen" = "yes" || return 1 + test "$target_softmmu" = "yes" || return 1 + case "$target_name:$cpu" in + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64) + return 0 + ;; + esac + return 1 +} + for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak @@ -4538,34 +4564,20 @@ if [ "$TARGET_ABI_DIR" = "" ]; then TARGET_ABI_DIR=$TARGET_ARCH fi echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak -case "$target_name" in - i386|x86_64) - if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then - echo "CONFIG_XEN=y" >> $config_target_mak - if test "$xen_pci_passthrough" = yes; then + +if supported_xen_target; then + echo "CONFIG_XEN=y" >> $config_target_mak + if test "$xen_pci_passthrough" = yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" - fi fi - ;; - *) -esac -case "$target_name" in - aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x) +fi +if supported_kvm_target; then # Make sure the target and host cpus are compatible - if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ - \( "$target_name" = "$cpu" -o \ - \( "$target_name" = "ppcemb" -a "$cpu" = "ppc" \) -o \ - \( "$target_name" = "ppc64" -a "$cpu" = "ppc" \) -o \ - \( "$target_name" = "ppc" -a "$cpu" = "ppc64" \) -o \ - \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ - \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \ - \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) \) ; then - echo "CONFIG_KVM=y" >> $config_target_mak - if test "$vhost_net" = "yes" ; then + echo "CONFIG_KVM=y" >> $config_target_mak + if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak - fi fi -esac +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fi