[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KV
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets |
Date: |
Wed, 5 Jul 2017 09:14:25 +0200 |
This will be useful when the functions are called, early in the configure
process, to filter out targets that do not support hardware acceleration.
Signed-off-by: Paolo Bonzini <address@hidden>
---
configure | 90 ++++++++++++++++++++++++++++++++++++++-------------------------
1 file changed, 55 insertions(+), 35 deletions(-)
diff --git a/configure b/configure
index c571ad1..0f14e79 100755
--- a/configure
+++ b/configure
@@ -163,6 +163,50 @@ have_backend () {
echo "$trace_backends" | grep "$1" >/dev/null
}
+glob() {
+ eval test -z '"${1#'"$2"'}"'
+}
+
+supported_hax_target() {
+ test "$hax" = "yes" || return 1
+ glob "$1" "*-softmmu" || return 1
+ case "${1%-softmmu}" in
+ i386|x86_64)
+ return 0
+ ;;
+ esac
+ return 1
+}
+
+supported_kvm_target() {
+ test "$kvm" = "yes" || return 1
+ glob "$1" "*-softmmu" || return 1
+ case "${1%-softmmu}:$cpu" in
+ arm:arm | aarch64:aarch64 | \
+ i386:i386 | i386:x86_64 | i386:x32 | \
+ x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \
+ mips:mips | mipsel:mips | \
+ 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
+ glob "$1" "*-softmmu" || return 1
+ case "${1%-softmmu}:$cpu" in
+ arm:arm | aarch64:aarch64 | \
+ i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64)
+ return 0
+ ;;
+ esac
+ return 1
+}
+
# default parameters
source_path=$(dirname "$0")
cpu=""
@@ -6178,46 +6222,22 @@ echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >>
$config_target_mak
if [ "$HOST_VARIANT_DIR" != "" ]; then
echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak
fi
-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 $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|mipsel|mips)
- # 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" = "mipsel" -a "$cpu" = "mips" \) -o \
- \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \
- \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) -o \
- \( "$target_name" = "x86_64" -a "$cpu" = "x32" \) -o \
- \( "$target_name" = "i386" -a "$cpu" = "x32" \) \) ; then
- echo "CONFIG_KVM=y" >> $config_target_mak
- if test "$vhost_net" = "yes" ; then
+fi
+if supported_kvm_target $target; then
+ echo "CONFIG_KVM=y" >> $config_target_mak
+ if test "$vhost_net" = "yes" ; then
echo "CONFIG_VHOST_NET=y" >> $config_target_mak
echo "CONFIG_VHOST_NET_TEST_$target_name=y" >> $config_host_mak
- fi
fi
-esac
-if test "$hax" = "yes" ; then
- if test "$target_softmmu" = "yes" ; then
- case "$target_name" in
- i386|x86_64)
- echo "CONFIG_HAX=y" >> $config_target_mak
- ;;
- esac
- fi
+fi
+if supported_hax_target $target; then
+ echo "CONFIG_HAX=y" >> $config_target_mak
fi
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
--
1.8.3.1
- [Qemu-devel] [PULL 15/42] util/oslib-win32: Remove if conditional, (continued)
- [Qemu-devel] [PULL 15/42] util/oslib-win32: Remove if conditional, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not be NUL terminated, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 11/42] Makefile: Move bootdevice.o to common-obj-y, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 12/42] hw/misc/edu: Compile the edu device as common object, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 10/42] include/exec/poison: Mark CONFIG_SOFTMMU as poisoned, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 18/42] checkpatch: should not use signal except for SIG_DFL or SIG_IGN, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 14/42] xsave_helper: pull xsave and xrstor out of kvm.c into helper function, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 16/42] tests/test-char.c: Don't use main_loop_wait()'s return value, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 19/42] virtio-scsi: finalize IOMMU support, Paolo Bonzini, 2017/07/05
- [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets,
Paolo Bonzini <=
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Peter Maydell, 2017/07/10
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/10
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Peter Maydell, 2017/07/10
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/10
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Philippe Mathieu-Daudé, 2017/07/14
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Paolo Bonzini, 2017/07/14
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Stefano Stabellini, 2017/07/11
- Re: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets, Anthony PERARD, 2017/07/10
[Qemu-devel] [PULL 24/42] configure: add --disable-tcg configure option, Paolo Bonzini, 2017/07/05