[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/20] coroutine: adding configure choose mechanism
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 18/20] coroutine: adding configure choose mechanism for coroutine backend |
Date: |
Mon, 12 Mar 2012 16:19:49 +0100 |
From: Alex Barcelo <address@hidden>
Configure tries, as a default, ucontext functions for the
coroutines. But now the user can force another backend by
--with-coroutine=BACKEND option
v2: Using --with-coroutine=BACKEND instead of enable
disable individual configure options
Signed-off-by: Alex Barcelo <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
configure | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/configure b/configure
index 39d2b54..bb80822 100755
--- a/configure
+++ b/configure
@@ -194,6 +194,7 @@ opengl=""
zlib="yes"
guest_agent="yes"
libiscsi=""
+coroutine=""
# parse CC options first
for opt do
@@ -784,6 +785,8 @@ for opt do
;;
--with-pkgversion=*) pkgversion=" ($optarg)"
;;
+ --with-coroutine=*) coroutine="$optarg"
+ ;;
--disable-docs) docs="no"
;;
--enable-docs) docs="yes"
@@ -1110,6 +1113,8 @@ echo " --disable-usb-redir disable usb network
redirection support"
echo " --enable-usb-redir enable usb network redirection support"
echo " --disable-guest-agent disable building of the QEMU Guest Agent"
echo " --enable-guest-agent enable building of the QEMU Guest Agent"
+echo " --with-coroutine=BACKEND coroutine backend. Supported options:"
+echo " gthread, ucontext, windows"
echo ""
echo "NOTE: The object files are built at the place where configure is
launched"
exit 1
@@ -2715,21 +2720,36 @@ EOF
fi
##########################################
-# check if we have makecontext
-# (and that it's not a glibc stub which always returns -1)
+# check and set a backend for coroutine
-ucontext_coroutine=no
-if test "$darwin" != "yes"; then
- cat > $TMPC << EOF
+# default is ucontext, but always fallback to gthread
+# windows autodetected by make
+if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then
+ if test "$darwin" != "yes"; then
+ cat > $TMPC << EOF
#include <ucontext.h>
#ifdef __stub_makecontext
#error Ignoring glibc stub makecontext which will always fail
#endif
int main(void) { makecontext(0, 0, 0); return 0; }
EOF
- if compile_prog "" "" ; then
- ucontext_coroutine=yes
+ if compile_prog "" "" ; then
+ coroutine_backend=ucontext
+ else
+ coroutine_backend=gthread
+ fi
+ else
+ echo "Silently falling back into gthread backend under darwin"
fi
+elif test "$coroutine" = "gthread" ; then
+ coroutine_backend=gthread
+elif test "$coroutine" = "windows" ; then
+ coroutine_backend=windows
+else
+ echo
+ echo "Error: unknown coroutine backend $coroutine"
+ echo
+ exit 1
fi
##########################################
@@ -2931,6 +2951,7 @@ echo "usb net redir $usb_redir"
echo "OpenGL support $opengl"
echo "libiscsi support $libiscsi"
echo "build guest agent $guest_agent"
+echo "coroutine backend $coroutine_backend"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -3246,7 +3267,7 @@ if test "$rbd" = "yes" ; then
echo "CONFIG_RBD=y" >> $config_host_mak
fi
-if test "$ucontext_coroutine" = "yes" ; then
+if test "$coroutine_backend" = "ucontext" ; then
echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
fi
--
1.7.6.5
- [Qemu-devel] [PULL 00/20] Block patches, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 08/20] Add 'make check-block', Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 05/20] qcow2: Add error messages in qcow2_truncate, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 06/20] qemu-iotests: Mark some tests as quick, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 02/20] qed: do not evict in-use L2 table cache entries, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 01/20] Group snapshot: Fix format name for backing file, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 16/20] qcow2: Reduce number of I/O requests, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 03/20] qcow2: Add some tracing, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 17/20] coroutine: adding sigaltstack method (.c source), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 18/20] coroutine: adding configure choose mechanism for coroutine backend,
Kevin Wolf <=
- [Qemu-devel] [PATCH 10/20] qapi: complete implementation of unions, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 04/20] block: handle -EBUSY in bdrv_commit_all(), Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 20/20] test-coroutine: add performance test for nesting, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 07/20] make check: Add qemu-iotests subset, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 14/20] qcow2: Factor out count_cow_clusters, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 09/20] use QSIMPLEQ_FOREACH_SAFE when freeing list elements, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 12/20] add mode field to blockdev-snapshot-sync transaction item, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 19/20] coroutine: adding configure option for sigaltstack coroutine backend, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 13/20] qmp: convert blockdev-snapshot-sync to a wrapper around transactions, Kevin Wolf, 2012/03/12
- [Qemu-devel] [PATCH 11/20] rename blockdev-group-snapshot-sync, Kevin Wolf, 2012/03/12