提交 7e70cdba 编写于 作者: P Paolo Bonzini 提交者: Kevin Wolf

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: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 7d9c8581
...@@ -40,7 +40,8 @@ static void test_in_coroutine(void) ...@@ -40,7 +40,8 @@ static void test_in_coroutine(void)
static void coroutine_fn verify_self(void *opaque) 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) static void test_self(void)
...@@ -48,7 +49,7 @@ static void test_self(void) ...@@ -48,7 +49,7 @@ static void test_self(void)
Coroutine *coroutine; Coroutine *coroutine;
coroutine = qemu_coroutine_create(verify_self); coroutine = qemu_coroutine_create(verify_self);
qemu_coroutine_enter(coroutine, coroutine); qemu_coroutine_enter(coroutine, &coroutine);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册