On Mon, Feb 13, 2012 at 03:42:30PM +0100, Alex Barcelo wrote: > It's possible to enable/disable sigaltstack, but it always has > less priority than ucontext method (to force sigaltstack, > ucontext has to be disabled). > > Signed-off-by: Alex Barcelo <abarc...@ac.upc.edu> > --- > Makefile.objs | 4 ++++ > configure | 39 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+), 0 deletions(-) > > diff --git a/Makefile.objs b/Makefile.objs > index 391e524..8874825 100644 > --- a/Makefile.objs > +++ b/Makefile.objs > @@ -17,8 +17,12 @@ coroutine-obj-y += qemu-coroutine-sleep.o > ifeq ($(CONFIG_UCONTEXT_COROUTINE),y) > coroutine-obj-$(CONFIG_POSIX) += coroutine-ucontext.o > else > +ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y) > +coroutine-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o > +else > coroutine-obj-$(CONFIG_POSIX) += coroutine-gthread.o > endif > +endif > coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o > > ####################################################################### > diff --git a/configure b/configure > index ed40da8..e9c27f3 100755 > --- a/configure > +++ b/configure > @@ -191,6 +191,7 @@ zlib="yes" > guest_agent="yes" > libiscsi="" > ucontext="" > +sigaltstack="" > > # parse CC options first > for opt do > @@ -803,6 +804,10 @@ for opt do > ;; > --disable-ucontext) ucontext="no" > ;; > + --enable-sigaltstack) sigaltstack="yes" > + ;; > + --disable-sigaltstack) sigaltstack="no" > + ;; > *) echo "ERROR: unknown option $opt"; show_help="yes" > ;; > esac > @@ -1091,6 +1096,8 @@ echo " --disable-guest-agent disable building of > the QEMU Guest Agent" > echo " --enable-guest-agent enable building of the QEMU Guest Agent" > echo " --disable-ucontext disable ucontext functions for coroutines" > echo " --enable-ucontext enable ucontext functions for coroutines" > +echo " --disable-sigaltstack disable sigaltstack functions for > coroutines" > +echo " --enable-sigaltstack enable sigaltstack functions for coroutines"
Since the 3 different coroutine impls are mutually exclusive choices, perhaps it'd be preferable to just have a single configure argument like --with-couroutines=[ucontext|sigaltstack|gthread] Thus avoiding the non-sensical scenario of the user specifying --enable-ucontext --enable-sigaltstack Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|