Received: from eggs.gnu.org ([2001:4830:134:3::10]:42863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNJd7-0007qi-DL for qemu-devel@nongnu.org; Wed, 13 Jul 2016 08:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNJd6-00047R-FZ for qemu-devel@nongnu.org; Wed, 13 Jul 2016 08:51:09 -0400 From: Kevin Wolf Date: Wed, 13 Jul 2016 14:50:22 +0200 Message-Id: <1468414241-13119-16-git-send-email-kwolf@redhat.com> In-Reply-To: <1468414241-13119-1-git-send-email-kwolf@redhat.com> References: <1468414241-13119-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL v2 15/34] test-coroutine: prepare for the next patch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini The next patch moves the coroutine argument from first-enter to creation time. In this case, coroutine has not been initialized yet when the coroutine is created, so change to a pointer. Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- tests/test-coroutine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index 215b92e..5171174 100644 --- a/tests/test-coroutine.c +++ b/tests/test-coroutine.c @@ -40,7 +40,8 @@ static void test_in_coroutine(void) static void coroutine_fn verify_self(void *opaque) { - g_assert(qemu_coroutine_self() == opaque); + Coroutine **p_co = opaque; + g_assert(qemu_coroutine_self() == *p_co); } static void test_self(void) @@ -48,7 +49,7 @@ static void test_self(void) Coroutine *coroutine; coroutine = qemu_coroutine_create(verify_self); - qemu_coroutine_enter(coroutine, coroutine); + qemu_coroutine_enter(coroutine, &coroutine); } /* -- 1.8.3.1