From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] test-coroutine: prepare for the next patch
Date: Mon, 4 Jul 2016 19:10:00 +0200 [thread overview]
Message-ID: <1467652201-51688-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1467652201-51688-1-git-send-email-pbonzini@redhat.com>
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>
---
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
next prev parent reply other threads:[~2016-07-04 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 17:09 [Qemu-devel] [PATCH for-2.7? 0/3] Two coroutine tweaks Paolo Bonzini
2016-07-04 17:09 ` [Qemu-devel] [PATCH 1/3] coroutine: use QSIMPLEQ instead of QTAILQ Paolo Bonzini
2016-07-04 17:10 ` Paolo Bonzini [this message]
2016-07-04 17:10 ` [Qemu-devel] [PATCH 3/3] coroutine: move entry argument to qemu_coroutine_create Paolo Bonzini
2016-07-05 9:09 ` [Qemu-devel] [PATCH for-2.7? 0/3] Two coroutine tweaks Fam Zheng
2016-07-08 15:50 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467652201-51688-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).