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 <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Paolo Bonzini 2016-07-04 19:10:00 +02:00 committed by Kevin Wolf
parent 7d9c858137
commit 7e70cdba9f
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}
/*