From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Faria <afaria@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Weil <sw@weilnetz.de>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [PATCH] coroutine: Make qemu_coroutine_self() return NULL if not in coroutine
Date: Wed, 5 Oct 2022 18:34:09 +0200 [thread overview]
Message-ID: <Yz2yAWVMUrkaCNYY@redhat.com> (raw)
In-Reply-To: <20221005142006.926013-1-afaria@redhat.com>
Am 05.10.2022 um 16:20 hat Alberto Faria geschrieben:
> qemu_coroutine_self() is used in several places outside of coroutine
> context (mostly in qcow2 tracing calls).
>
> Ensure qemu_coroutine_self() works properly when not called from
> coroutine context, returning NULL in that case, and remove its
> coroutine_fn annotation.
>
> Signed-off-by: Alberto Faria <afaria@redhat.com>
The coroutine_fn annotation for qemu_coroutine_self() is wrong, but I
think it already works outside of coroutine context, and consistently in
all three backends, by returning &leader.
Changing that to NULL makes me kind of nervous because the callers might
actually access the leader Coroutine object, and after this change they
would crash. (And even if they didn't crash, they wouldn't be able to
distinguish the leader coroutines of different threads any more.)
Do we have an actual reason to make this chance? That is, do we have any
case that was broken before?
Kevin
next prev parent reply other threads:[~2022-10-05 17:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 14:20 [PATCH] coroutine: Make qemu_coroutine_self() return NULL if not in coroutine Alberto Faria
2022-10-05 16:34 ` Kevin Wolf [this message]
2022-10-05 17:40 ` Alberto Campinho Faria
2022-10-06 15:20 ` Stefan Hajnoczi
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=Yz2yAWVMUrkaCNYY@redhat.com \
--to=kwolf@redhat.com \
--cc=afaria@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.