Skip to contentSkip to conversation

coroutine: Drop coroutine_fn annotation from qemu_coroutine_self()

PATCH Applied Alberto Faria 3 participants 3 messages Oct 5, 2022 – Oct 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coroutine: Drop coroutine_fn annotation from qemu_coroutine_self()

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).

---
 include/qemu/coroutine.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/coroutine.h +1 -1
index c61dd2d3f7..c77ccd80f5 100644
@@ -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
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Alberto Faria

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).

---
  include/qemu/coroutine.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/coroutine.h +0 -0
index c61dd2d3f7..c77ccd80f5 100644

include/qemu/coroutine.h AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co); · line 128

Quoted 8 lines
include/qemu/coroutine.h +1 -1
@@ -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!

Paolo

Applied
#2 lore raw
In reply to Alberto Faria

Am 05.10.2022 um 19:52 hat Alberto Faria geschrieben:

Quoted 5 lines

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).

Thanks, applied to the block branch.

Kevin