From: Paolo Bonzini Date: Mon, 4 Jul 2016 17:10:00 +0000 (+0200) Subject: test-coroutine: prepare for the next patch X-Git-Tag: v2.7.0-rc0~32^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e70cdba9f220bef3f3481c663c066c2b80469aa;p=thirdparty%2Fqemu.git test-coroutine: prepare for the next patch 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 --- diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index 215b92e636e..51711744c86 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); } /*