qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] test-coroutine: prepare for the next patch


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 2/3] test-coroutine: prepare for the next patch
Date: Mon, 4 Jul 2016 19:10:00 +0200

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 <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]