diff mbox series

coroutine: Drop coroutine_fn annotation from qemu_coroutine_self()

Message ID 20221005175209.975797-1-afaria@redhat.com
State New
Headers show
Series coroutine: Drop coroutine_fn annotation from qemu_coroutine_self() | expand

Commit Message

Alberto Faria Oct. 5, 2022, 5:52 p.m. UTC
qemu_coroutine_self() can be called from outside coroutine context,
returning the leader coroutine, and several such invocations currently
exist (mostly in qcow2 tracing calls).

Signed-off-by: Alberto Faria <afaria@redhat.com>
---
 include/qemu/coroutine.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Oct. 5, 2022, 10:07 p.m. UTC | #1
On 10/5/22 19:52, Alberto Faria wrote:
> qemu_coroutine_self() can be called from outside coroutine context,
> returning the leader coroutine, and several such invocations currently
> exist (mostly in qcow2 tracing calls).
> 
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
>   include/qemu/coroutine.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
> index c61dd2d3f7..c77ccd80f5 100644
> --- a/include/qemu/coroutine.h
> +++ b/include/qemu/coroutine.h
> @@ -122,7 +122,7 @@ AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co);
>   /**
>    * Get the currently executing coroutine
>    */
> -Coroutine *coroutine_fn qemu_coroutine_self(void);
> +Coroutine *qemu_coroutine_self(void);
>   
>   /**
>    * Return whether or not currently inside a coroutine

The alternative would be to have two versions, one that is coroutine_fn 
and one that isn't, but this is certainly okay too!

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Kevin Wolf Oct. 6, 2022, 8:37 a.m. UTC | #2
Am 05.10.2022 um 19:52 hat Alberto Faria geschrieben:
> qemu_coroutine_self() can be called from outside coroutine context,
> returning the leader coroutine, and several such invocations currently
> exist (mostly in qcow2 tracing calls).
> 
> Signed-off-by: Alberto Faria <afaria@redhat.com>

Thanks, applied to the block branch.

Kevin
diff mbox series

Patch

diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index c61dd2d3f7..c77ccd80f5 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -122,7 +122,7 @@  AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co);
 /**
  * Get the currently executing coroutine
  */
-Coroutine *coroutine_fn qemu_coroutine_self(void);
+Coroutine *qemu_coroutine_self(void);
 
 /**
  * Return whether or not currently inside a coroutine