From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSAO-0002QM-Hr for qemu-devel@nongnu.org; Thu, 19 Feb 2015 09:33:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOSAK-0001aL-8r for qemu-devel@nongnu.org; Thu, 19 Feb 2015 09:33:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSAK-0001Zq-1N for qemu-devel@nongnu.org; Thu, 19 Feb 2015 09:33:20 -0500 Date: Thu, 19 Feb 2015 14:33:12 +0000 From: Stefan Hajnoczi Message-ID: <20150219143312.GA3032@stefanha-thinkpad.redhat.com> References: <1423564888-14933-1-git-send-email-kwolf@redhat.com> <1423564888-14933-3-git-send-email-kwolf@redhat.com> <20150218135051.GF7629@stefanha-thinkpad.redhat.com> <20150218142026.GE4996@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <20150218142026.GE4996@noname.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , famz@redhat.com, qemu-devel@nongnu.org, wu.wubin@huawei.com, pbonzini@redhat.com --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 18, 2015 at 03:20:26PM +0100, Kevin Wolf wrote: > Am 18.02.2015 um 14:50 hat Stefan Hajnoczi geschrieben: > > On Tue, Feb 10, 2015 at 11:41:27AM +0100, Kevin Wolf wrote: > > > qemu_coroutine_enter() is now the only user of coroutine_swap(). Both > > > functions are short, so inline it. > > >=20 > > > Also, using COROUTINE_YIELD is now even more confusing because this c= ode > > > is never called during qemu_coroutine_yield() any more. In fact, this > > > value is never read back, so we can just introduce a new COROUTINE_EN= TER > > > which documents the purpose of the task switch better. > > >=20 > > > Signed-off-by: Kevin Wolf > > > --- > > > include/block/coroutine_int.h | 1 + > > > qemu-coroutine.c | 36 +++++++++++++++------------------= --- > > > 2 files changed, 16 insertions(+), 21 deletions(-) > > >=20 > > > diff --git a/include/block/coroutine_int.h b/include/block/coroutine_= int.h > > > index f133d65..69b83db 100644 > > > --- a/include/block/coroutine_int.h > > > +++ b/include/block/coroutine_int.h > > > @@ -29,6 +29,7 @@ > > > #include "block/coroutine.h" > > > =20 > > > typedef enum { > > > + COROUTINE_ENTER =3D 0, > >=20 > > This makes the ucontext code harder to understand because > > CoroutineAction values are used with setjmp()/longjmp() in > > qemu_coroutine_switch(). > >=20 > > The longjmp() man page says: > >=20 > > If longjmp() is invoked with a second argument of 0, 1 will be > > returned instead. > >=20 > > I haven't checked whether or not this causes problems, but the code > > would be simpler if we avoided using 0. >=20 > It doesn't, the value is unused where we pass COROUTINE_ENTER. But I can > make it 3 instead. Thanks, that would be good. Stefan --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU5fQoAAoJEJykq7OBq3PIWNQIALlEZ8Xz+NqYVO+SMv+ciwHo MwD5AwVk1oedaFl6H4Z3VdoeIax9bjd1G4LaWlCkXQONdXohq+qj9+btCgGxdm1e 6dWK6QYWxFfNmiReP2Ij7Ji6+8EyK6M9tg33h7x69Mid3KU/h4f5XQTg2Nq/Xgyp fmOikPkqChfvdsAU/EOnJViJ/mMHa0o/+UpR4x4EcKOV65PwBJPTuuthKb4bG9oC OwiwXXicacBcVd80KqUKvuubY5KdV10ug5sC3glX+s2DLcSqhRC+bcLAyAi6Pl14 o5R0eyl8g7dF4CIwR1wR/n5q7f0tvPvM4dEmy/M5GIwfszky9KqWwnzvnw00UUo= =mdAH -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--