* [PATCH 0/8] coroutine: add missing annotations
@ 2026-07-20 7:55 Marc-André Lureau
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
` (7 more replies)
0 siblings, 8 replies; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
Hi
Add missing coroutine_fn, coroutine_mixed_fn annotations and fix
a few related issues across monitor, migration, io, block, and
9pfs subsystems.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Marc-André Lureau (8):
monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
migration: fix qemu_get_counted_string annotation
io: add missing coroutine annotation
block: add missing coroutine annotation
qcow2: remove invalid qcow2_check_refcounts calls
block: add missing coroutine_fn annotations
hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
migration/rdma: annotate and simplify wait_comp_channel()
hw/9pfs/9p.h | 26 +++++++++++++++-----------
include/block/blockjob_int.h | 2 +-
include/io/channel.h | 4 ++--
block/commit.c | 5 +++--
block/crypto.c | 13 +++++++------
block/io.c | 8 +++++---
block/parallels.c | 5 +++--
block/qcow2-snapshot.c | 18 ------------------
block/qcow2.c | 11 +++++++----
blockjob.c | 3 ++-
hw/9pfs/9p.c | 31 +++++++++++++++++++------------
hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
io/channel.c | 5 +++--
migration/qemu-file.c | 2 +-
migration/rdma.c | 12 ++++--------
monitor/qmp.c | 3 ++-
17 files changed, 104 insertions(+), 102 deletions(-)
---
base-commit: 5ef0ecc5942ee07bb581cc96a97bbfc0fdf4005c
change-id: 20260720-co-625d98c7dc5e
Best regards,
--
Marc-André Lureau <marcandre.lureau@redhat.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 12:34 ` Markus Armbruster
2026-07-20 14:26 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
` (6 subsequent siblings)
7 siblings, 2 replies; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
The function calls qemu_coroutine_yield(), and is called from
monitor_qmp_dispatcher_co().
Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
monitor/qmp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/monitor/qmp.c b/monitor/qmp.c
index 223e0643c2a..338d37cb7e5 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -342,7 +342,8 @@ static QMPRequest *monitor_qmp_requests_pop_any_with_lock(void)
return req_obj;
}
-static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
+static QMPRequest * coroutine_fn
+monitor_qmp_dispatcher_pop_any(void)
{
while (true) {
/*
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/8] migration: fix qemu_get_counted_string annotation
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 14:09 ` Peter Xu
2026-07-20 14:27 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 3/8] io: add missing coroutine annotation Marc-André Lureau
` (5 subsequent siblings)
7 siblings, 2 replies; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
migration/qemu-file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index d5a48115bd6..f30e13c66d7 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -830,7 +830,7 @@ uint64_t qemu_get_be64(QEMUFile *f)
* else 0
* (Note a 0 length string will return 0 either way)
*/
-size_t coroutine_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
+size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
{
size_t len = qemu_get_byte(f);
size_t res = qemu_get_buffer(f, (uint8_t *)buf, len);
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/8] io: add missing coroutine annotation
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
2026-07-20 7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 14:28 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 4/8] block: " Marc-André Lureau
` (4 subsequent siblings)
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/io/channel.h | 4 ++--
io/channel.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/io/channel.h b/include/io/channel.h
index 98485c9280a..c90ace20d53 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
* This will work with/without a coroutine context, by automatically select
* the proper API to wait.
*/
-void qio_channel_wait_cond(QIOChannel *ioc,
- GIOCondition condition);
+void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,
+ GIOCondition condition);
/**
* qio_channel_set_aio_fd_handler:
diff --git a/io/channel.c b/io/channel.c
index 2853dadb684..620256f310d 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
g_main_context_unref(ctxt);
}
-void qio_channel_wait_cond(QIOChannel *ioc,
- GIOCondition condition)
+void coroutine_mixed_fn
+qio_channel_wait_cond(QIOChannel *ioc,
+ GIOCondition condition)
{
if (qemu_in_coroutine()) {
qio_channel_yield(ioc, condition);
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 4/8] block: add missing coroutine annotation
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
` (2 preceding siblings ...)
2026-07-20 7:55 ` [PATCH 3/8] io: add missing coroutine annotation Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 14:28 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls Marc-André Lureau
` (3 subsequent siblings)
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
The function was extracted without carrying the annotation.
Fixes: 23743ab282af ("block: move commit_run loop to separate function")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
block/commit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index c5e3ef03a21..2d52c39594c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -128,8 +128,9 @@ static void commit_clean(Job *job)
blk_unref(s->top);
}
-static int commit_iteration(CommitBlockJob *s, int64_t offset,
- int64_t *requested_bytes, void *buf)
+static int coroutine_fn
+commit_iteration(CommitBlockJob *s, int64_t offset,
+ int64_t *requested_bytes, void *buf)
{
BlockErrorAction action;
int64_t bytes = *requested_bytes;
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
` (3 preceding siblings ...)
2026-07-20 7:55 ` [PATCH 4/8] block: " Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 20:57 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 6/8] block: add missing coroutine_fn annotations Marc-André Lureau
` (2 subsequent siblings)
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
from non-coroutine. Remove it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
block/qcow2-snapshot.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 1e8dc48be1c..8453ad73d10 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
ROUND_UP(sn->vm_state_size, s->cluster_size),
QCOW2_DISCARD_NEVER, false);
-#ifdef DEBUG_ALLOC
- {
- BdrvCheckResult result = {0};
- qcow2_check_refcounts(bs, &result, 0);
- }
-#endif
return 0;
fail:
@@ -893,12 +887,6 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
goto fail;
}
-#ifdef DEBUG_ALLOC
- {
- BdrvCheckResult result = {0};
- qcow2_check_refcounts(bs, &result, 0);
- }
-#endif
return 0;
fail:
@@ -975,12 +963,6 @@ int qcow2_snapshot_delete(BlockDriverState *bs,
return ret;
}
-#ifdef DEBUG_ALLOC
- {
- BdrvCheckResult result = {0};
- qcow2_check_refcounts(bs, &result, 0);
- }
-#endif
return 0;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 6/8] block: add missing coroutine_fn annotations
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
` (4 preceding siblings ...)
2026-07-20 7:55 ` [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 20:58 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn Marc-André Lureau
2026-07-20 7:55 ` [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel() Marc-André Lureau
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
The functions call coroutine functions or are called by coroutine.
Add an assert() in qcow2_do_close() code path which calls a
no_coroutine_fn bdrv_graph_wrlock_drained().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/block/blockjob_int.h | 2 +-
block/crypto.c | 13 +++++++------
block/io.c | 8 +++++---
block/parallels.c | 5 +++--
block/qcow2.c | 11 +++++++----
blockjob.c | 3 ++-
6 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 4c3d2e25a20..34e172874fa 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -150,7 +150,7 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n);
* Put the job to sleep (assuming that it wasn't canceled) to throttle it to the
* right speed according to its rate limiting.
*/
-void block_job_ratelimit_sleep(BlockJob *job);
+void coroutine_fn block_job_ratelimit_sleep(BlockJob *job);
/**
* block_job_error_action:
diff --git a/block/crypto.c b/block/crypto.c
index 36abb7af468..8a34d92fded 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -56,12 +56,13 @@ static int block_crypto_probe_generic(QCryptoBlockFormat format,
}
-static int block_crypto_read_func(QCryptoBlock *block,
- size_t offset,
- uint8_t *buf,
- size_t buflen,
- void *opaque,
- Error **errp)
+static int coroutine_mixed_fn
+block_crypto_read_func(QCryptoBlock *block,
+ size_t offset,
+ uint8_t *buf,
+ size_t buflen,
+ void *opaque,
+ Error **errp)
{
BlockDriverState *bs = opaque;
BlockCrypto *crypto = bs->opaque;
diff --git a/block/io.c b/block/io.c
index a916b236c3c..99dd16864a3 100644
--- a/block/io.c
+++ b/block/io.c
@@ -346,8 +346,9 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs,
assert(data.done);
}
-static void bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
- bool poll)
+static void coroutine_mixed_fn
+bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
+ bool poll)
{
IO_OR_GS_CODE();
@@ -397,7 +398,8 @@ bdrv_drained_begin(BlockDriverState *bs)
* This function does not poll, nor must any of its recursively called
* functions.
*/
-static void bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
+static void coroutine_mixed_fn
+bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
{
IO_OR_GS_CODE();
diff --git a/block/parallels.c b/block/parallels.c
index 7a90fb5220b..46a6e8f2743 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState *s, int64_t off)
return off / s->cluster_size;
}
-static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
- int nb_sectors, int *pnum)
+static int64_t coroutine_fn
+block_status(BDRVParallelsState *s, int64_t sector_num,
+ int nb_sectors, int *pnum)
{
int64_t start_off = -2, prev_end_off = -2;
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49..161626fa3cb 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1287,9 +1287,10 @@ fail:
}
/* s_locked specifies whether s->lock is held or not */
-static void qcow2_update_options_commit(BlockDriverState *bs,
- Qcow2ReopenState *r,
- bool s_locked)
+static void coroutine_fn
+qcow2_update_options_commit(BlockDriverState *bs,
+ Qcow2ReopenState *r,
+ bool s_locked)
{
BDRVQcow2State *s = bs->opaque;
int i;
@@ -2126,7 +2127,8 @@ fail:
return ret;
}
-static void qcow2_reopen_commit(BDRVReopenState *state)
+static void coroutine_fn
+qcow2_reopen_commit(BDRVReopenState *state)
{
BDRVQcow2State *s = state->bs->opaque;
@@ -2905,6 +2907,7 @@ qcow2_do_close(BlockDriverState *bs, bool close_data_file)
g_free(s->image_backing_format);
if (close_data_file && has_data_file(bs)) {
+ assert(!qemu_in_coroutine());
GLOBAL_STATE_CODE();
bdrv_graph_rdunlock_main_loop();
bdrv_graph_wrlock_drained();
diff --git a/blockjob.c b/blockjob.c
index f3b11cc7a19..f3ad6a93125 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -338,7 +338,8 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n)
ratelimit_calculate_delay(&job->limit, n);
}
-void block_job_ratelimit_sleep(BlockJob *job)
+void coroutine_fn
+block_job_ratelimit_sleep(BlockJob *job)
{
uint64_t delay_ns;
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
` (5 preceding siblings ...)
2026-07-20 7:55 ` [PATCH 6/8] block: add missing coroutine_fn annotations Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 14:02 ` Christian Schoenebeck
2026-07-20 7:55 ` [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel() Marc-André Lureau
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
All V9fsTransport callbacks are invoked exclusively from coroutine
context (the v9fs_* PDU handlers). Annotate the function pointer
types in V9fsTransport and all implementations (virtio and xen
backends), as well as intermediate callers in 9p.c (pdu_marshal,
pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/9pfs/9p.h | 26 +++++++++++++++-----------
hw/9pfs/9p.c | 31 +++++++++++++++++++------------
hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
4 files changed, 64 insertions(+), 51 deletions(-)
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 1a309664f6e..0e52ffbdf38 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
void v9fs_reset(V9fsState *s);
struct V9fsTransport {
- ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
- va_list ap);
- ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
- va_list ap);
- void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
- unsigned int *pniov, size_t size);
- void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
- unsigned int *pniov, size_t size);
- void (*push_and_notify)(V9fsPDU *pdu);
- size_t (*msize_limit)(V9fsState *s);
- size_t (*response_buffer_size)(V9fsPDU *pdu);
+ ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
+ const char *fmt, va_list ap);
+ ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
+ const char *fmt, va_list ap);
+ void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
+ struct iovec **piov,
+ unsigned int *pniov,
+ size_t size);
+ void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
+ struct iovec **piov,
+ unsigned int *pniov,
+ size_t size);
+ void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
+ size_t coroutine_fn (*msize_limit)(V9fsState *s);
+ size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
};
#endif
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 3119f011173..00cfbae6dd5 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -55,7 +55,8 @@ enum {
P9ARRAY_DEFINE_TYPE(V9fsPath, v9fs_path_free);
-static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
{
ssize_t ret;
va_list ap;
@@ -67,7 +68,8 @@ static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
return ret;
}
-static ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
{
ssize_t ret;
va_list ap;
@@ -1841,7 +1843,8 @@ out_nofid:
pdu_complete(pdu, err);
}
-static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
+static int coroutine_fn
+v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
{
int i;
ssize_t err;
@@ -2363,9 +2366,10 @@ out_nofid:
* The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up
* with qemu_iovec_destroy().
*/
-static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
- size_t skip, size_t size,
- bool is_write)
+static void coroutine_fn
+v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
+ size_t skip, size_t size,
+ bool is_write)
{
QEMUIOVector elem;
struct iovec *iov;
@@ -2382,8 +2386,9 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
qemu_iovec_concat(qiov, &elem, skip, size);
}
-static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
- uint64_t off, uint32_t max_count)
+static int coroutine_fn
+v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+ uint64_t off, uint32_t max_count)
{
ssize_t err;
size_t offset = 7;
@@ -2793,9 +2798,10 @@ out_nofid:
pdu_complete(pdu, retval);
}
-static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
- uint64_t off, uint32_t count,
- struct iovec *sg, int cnt)
+static int coroutine_fn
+v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+ uint64_t off, uint32_t count,
+ struct iovec *sg, int cnt)
{
int i, to_copy;
ssize_t err = 0;
@@ -3729,7 +3735,8 @@ out_nofid:
pdu_complete(pdu, err);
}
-static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
+static int coroutine_fn
+v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
{
uint32_t f_type;
uint32_t f_bsize;
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 50dc93091d3..b2dd859fb56 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -28,7 +28,7 @@
#include "qemu/module.h"
#include "system/qtest.h"
-static void virtio_9p_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn virtio_9p_push_and_notify(V9fsPDU *pdu)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -117,8 +117,8 @@ static void virtio_9p_reset(VirtIODevice *vdev)
v9fs_reset(&v->state);
}
-static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
- const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -135,8 +135,8 @@ static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
return ret;
}
-static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
- const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -152,8 +152,9 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
return ret;
}
-static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
- unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+ unsigned int *pniov, size_t size)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -172,8 +173,9 @@ static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
*pniov = elem->in_num;
}
-static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
- unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+ unsigned int *pniov, size_t size)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -192,13 +194,13 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
*pniov = elem->out_num;
}
-static size_t virtio_9p_msize_limit(V9fsState *s)
+static size_t coroutine_fn virtio_9p_msize_limit(V9fsState *s)
{
const size_t guestPageSize = 4096;
return (VIRTQUEUE_MAX_SIZE - 2) * guestPageSize;
}
-static size_t virtio_9p_response_buffer_size(V9fsPDU *pdu)
+static size_t coroutine_fn virtio_9p_response_buffer_size(V9fsPDU *pdu)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 24c90d97ec9..7f674f84642 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -131,10 +131,10 @@ static void xen_9pfs_out_sg(Xen9pfsRing *ring,
}
}
-static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
- size_t offset,
- const char *fmt,
- va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
+ size_t offset,
+ const char *fmt,
+ va_list ap)
{
Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
struct iovec in_sg[2];
@@ -155,10 +155,10 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
return ret;
}
-static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
- size_t offset,
- const char *fmt,
- va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
+ size_t offset,
+ const char *fmt,
+ va_list ap)
{
Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
struct iovec out_sg[2];
@@ -178,10 +178,10 @@ static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
return ret;
}
-static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
- struct iovec **piov,
- unsigned int *pniov,
- size_t size)
+static void coroutine_fn xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
+ struct iovec **piov,
+ unsigned int *pniov,
+ size_t size)
{
Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -195,10 +195,10 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
*pniov = num;
}
-static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
- struct iovec **piov,
- unsigned int *pniov,
- size_t size)
+static void coroutine_fn xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
+ struct iovec **piov,
+ unsigned int *pniov,
+ size_t size)
{
Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -227,7 +227,7 @@ again:
*pniov = num;
}
-static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn xen_9pfs_push_and_notify(V9fsPDU *pdu)
{
RING_IDX prod;
Xen9pfsDev *priv = container_of(pdu->s, Xen9pfsDev, state);
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel()
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
` (6 preceding siblings ...)
2026-07-20 7:55 ` [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn Marc-André Lureau
@ 2026-07-20 7:55 ` Marc-André Lureau
2026-07-20 14:13 ` Peter Xu
7 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-20 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian, Marc-André Lureau
The function calls yield_until_fd_readable() (coroutine_fn) when in
coroutine context, and polls with qemu_poll_ns() otherwise.
Replace the migration-state proxy check with qemu_in_coroutine(),
which directly tests what matters.
Fixes: 2da776db4846 ("rdma: core logic")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
migration/rdma.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 3e37a1d4401..438419d1894 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
/* Wait for activity on the completion channel.
* Returns 0 on success, none-0 on error.
*/
-static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
- struct ibv_comp_channel *comp_channel)
+static int coroutine_mixed_fn
+qemu_rdma_wait_comp_channel(RDMAContext *rdma,
+ struct ibv_comp_channel *comp_channel)
{
struct rdma_cm_event *cm_event;
- /*
- * Coroutine doesn't start until migration_fd_process_incoming()
- * so don't yield unless we know we're running inside of a coroutine.
- */
- if (rdma->migration_started_on_destination &&
- migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
+ if (qemu_in_coroutine()) {
yield_until_fd_readable(comp_channel->fd);
} else {
/* This is the source side, we're in a separate thread
--
2.55.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
@ 2026-07-20 12:34 ` Markus Armbruster
2026-07-20 14:26 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 27+ messages in thread
From: Markus Armbruster @ 2026-07-20 12:34 UTC (permalink / raw)
To: Marc-André Lureau
Cc: qemu-devel, Peter Xu, Fabiano Rosas, Daniel P. Berrangé,
John Snow, Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz,
qemu-block, Stefan Hajnoczi, Fam Zheng, Denis V. Lunev,
Christian Schoenebeck, Greg Kurz, Michael S. Tsirkin,
Stefano Stabellini, Anthony PERARD, Edgar E. Iglesias, xen-devel,
Li Zhijian
Marc-André Lureau <marcandre.lureau@redhat.com> writes:
> The function calls qemu_coroutine_yield(), and is called from
> monitor_qmp_dispatcher_co().
>
> Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> monitor/qmp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/monitor/qmp.c b/monitor/qmp.c
> index 223e0643c2a..338d37cb7e5 100644
> --- a/monitor/qmp.c
> +++ b/monitor/qmp.c
> @@ -342,7 +342,8 @@ static QMPRequest *monitor_qmp_requests_pop_any_with_lock(void)
> return req_obj;
> }
>
> -static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
> +static QMPRequest * coroutine_fn
> +monitor_qmp_dispatcher_pop_any(void)
> {
> while (true) {
> /*
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-20 7:55 ` [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn Marc-André Lureau
@ 2026-07-20 14:02 ` Christian Schoenebeck
2026-07-20 20:42 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 27+ messages in thread
From: Christian Schoenebeck @ 2026-07-20 14:02 UTC (permalink / raw)
To: qemu-devel, Marc-André Lureau
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Greg Kurz, Michael S. Tsirkin, Stefano Stabellini,
Anthony PERARD, Edgar E. Iglesias, xen-devel, Li Zhijian
On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
> All V9fsTransport callbacks are invoked exclusively from coroutine
> context (the v9fs_* PDU handlers). Annotate the function pointer
> types in V9fsTransport and all implementations (virtio and xen
> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/9pfs/9p.h | 26 +++++++++++++++-----------
> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
> 4 files changed, 64 insertions(+), 51 deletions(-)
>
> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> index 1a309664f6e..0e52ffbdf38 100644
> --- a/hw/9pfs/9p.h
> +++ b/hw/9pfs/9p.h
> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
> void v9fs_reset(V9fsState *s);
>
>
> struct V9fsTransport {
> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
> - va_list ap);
> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
> - va_list ap);
> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
> - unsigned int *pniov, size_t size);
> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
> - unsigned int *pniov, size_t size);
> - void (*push_and_notify)(V9fsPDU *pdu);
> - size_t (*msize_limit)(V9fsState *s);
> - size_t (*response_buffer_size)(V9fsPDU *pdu);
> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
> + const char *fmt, va_list ap);
> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
> + const char *fmt, va_list ap);
> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> + struct iovec **piov,
> + unsigned int *pniov,
> + size_t size);
> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
> + struct iovec **piov,
> + unsigned int *pniov,
> + size_t size);
> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
> };
I wonder whether that could be made more diff/blame-friendly. Especially as
this currently only serves documentation purposes.
They way you are positioning coroutine_fn it usually resolves to an attribute
attached to the function's return type, not to the function itself, even
though clang/gcc handling it flexible. For attaching an attribute to the
function itself the attribute should either be attached before the function
declaration or after the function declaration. In both cases you could then
add it to its own, separate line, avoiding a lot of noise.
/Christian
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/8] migration: fix qemu_get_counted_string annotation
2026-07-20 7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
@ 2026-07-20 14:09 ` Peter Xu
2026-07-20 14:27 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 27+ messages in thread
From: Peter Xu @ 2026-07-20 14:09 UTC (permalink / raw)
To: Marc-André Lureau
Cc: qemu-devel, Markus Armbruster, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On Mon, Jul 20, 2026 at 11:55:31AM +0400, Marc-André Lureau wrote:
> Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel()
2026-07-20 7:55 ` [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel() Marc-André Lureau
@ 2026-07-20 14:13 ` Peter Xu
0 siblings, 0 replies; 27+ messages in thread
From: Peter Xu @ 2026-07-20 14:13 UTC (permalink / raw)
To: Marc-André Lureau
Cc: qemu-devel, Markus Armbruster, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On Mon, Jul 20, 2026 at 11:55:37AM +0400, Marc-André Lureau wrote:
> The function calls yield_until_fd_readable() (coroutine_fn) when in
> coroutine context, and polls with qemu_poll_ns() otherwise.
>
> Replace the migration-state proxy check with qemu_in_coroutine(),
> which directly tests what matters.
>
> Fixes: 2da776db4846 ("rdma: core logic")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Just to say we can also drop the var. I have a patch did it already but I
didn't get chance to revisit the series:
https://lore.kernel.org/qemu-devel/20251022192612.2737648-5-peterx@redhat.com/
So we can also pick that single patch up, then this patch can be
annotation-only. I'll leave it to you.
Thanks,
> ---
> migration/rdma.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 3e37a1d4401..438419d1894 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
> /* Wait for activity on the completion channel.
> * Returns 0 on success, none-0 on error.
> */
> -static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> - struct ibv_comp_channel *comp_channel)
> +static int coroutine_mixed_fn
> +qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> + struct ibv_comp_channel *comp_channel)
> {
> struct rdma_cm_event *cm_event;
>
> - /*
> - * Coroutine doesn't start until migration_fd_process_incoming()
> - * so don't yield unless we know we're running inside of a coroutine.
> - */
> - if (rdma->migration_started_on_destination &&
> - migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
> + if (qemu_in_coroutine()) {
> yield_until_fd_readable(comp_channel->fd);
> } else {
> /* This is the source side, we're in a separate thread
>
> --
> 2.55.0
>
--
Peter Xu
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
2026-07-20 12:34 ` Markus Armbruster
@ 2026-07-20 14:26 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 14:26 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> The function calls qemu_coroutine_yield(), and is called from
> monitor_qmp_dispatcher_co().
>
> Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> monitor/qmp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/8] migration: fix qemu_get_counted_string annotation
2026-07-20 7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
2026-07-20 14:09 ` Peter Xu
@ 2026-07-20 14:27 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 14:27 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> migration/qemu-file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/8] io: add missing coroutine annotation
2026-07-20 7:55 ` [PATCH 3/8] io: add missing coroutine annotation Marc-André Lureau
@ 2026-07-20 14:28 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 14:28 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/io/channel.h | 4 ++--
> io/channel.c | 5 +++--
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/io/channel.h b/include/io/channel.h
> index 98485c9280a..c90ace20d53 100644
> --- a/include/io/channel.h
> +++ b/include/io/channel.h
> @@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
> * This will work with/without a coroutine context, by automatically select
> * the proper API to wait.
> */
> -void qio_channel_wait_cond(QIOChannel *ioc,
> - GIOCondition condition);
> +void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,
Better using same alignment than below (more importantly in
a header), otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> + GIOCondition condition);
>
> /**
> * qio_channel_set_aio_fd_handler:
> diff --git a/io/channel.c b/io/channel.c
> index 2853dadb684..620256f310d 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
> g_main_context_unref(ctxt);
> }
>
> -void qio_channel_wait_cond(QIOChannel *ioc,
> - GIOCondition condition)
> +void coroutine_mixed_fn
> +qio_channel_wait_cond(QIOChannel *ioc,
> + GIOCondition condition)
> {
> if (qemu_in_coroutine()) {
> qio_channel_yield(ioc, condition);
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/8] block: add missing coroutine annotation
2026-07-20 7:55 ` [PATCH 4/8] block: " Marc-André Lureau
@ 2026-07-20 14:28 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 14:28 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> The function was extracted without carrying the annotation.
>
> Fixes: 23743ab282af ("block: move commit_run loop to separate function")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> block/commit.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-20 14:02 ` Christian Schoenebeck
@ 2026-07-20 20:42 ` Philippe Mathieu-Daudé
2026-07-20 20:54 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 20:42 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel, Marc-André Lureau
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Greg Kurz, Michael S. Tsirkin, Stefano Stabellini,
Anthony PERARD, Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 16:02, Christian Schoenebeck wrote:
> On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
>> All V9fsTransport callbacks are invoked exclusively from coroutine
>> context (the v9fs_* PDU handlers). Annotate the function pointer
>> types in V9fsTransport and all implementations (virtio and xen
>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>> hw/9pfs/9p.h | 26 +++++++++++++++-----------
>> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
>> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
>> 4 files changed, 64 insertions(+), 51 deletions(-)
>>
>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>> index 1a309664f6e..0e52ffbdf38 100644
>> --- a/hw/9pfs/9p.h
>> +++ b/hw/9pfs/9p.h
>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>> void v9fs_reset(V9fsState *s);
>>
>>
>> struct V9fsTransport {
>> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
>> - va_list ap);
>> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
>> - va_list ap);
>> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
>> - unsigned int *pniov, size_t size);
>> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
>> - unsigned int *pniov, size_t size);
>> - void (*push_and_notify)(V9fsPDU *pdu);
>> - size_t (*msize_limit)(V9fsState *s);
>> - size_t (*response_buffer_size)(V9fsPDU *pdu);
>> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
>> + const char *fmt, va_list ap);
>> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
>> + const char *fmt, va_list ap);
>> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>> + struct iovec **piov,
>> + unsigned int *pniov,
>> + size_t size);
>> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>> + struct iovec **piov,
>> + unsigned int *pniov,
>> + size_t size);
>> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
>> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>> };
>
> I wonder whether that could be made more diff/blame-friendly. Especially as
> this currently only serves documentation purposes.
>
> They way you are positioning coroutine_fn it usually resolves to an attribute
> attached to the function's return type, not to the function itself, even
> though clang/gcc handling it flexible. For attaching an attribute to the
> function itself the attribute should either be attached before the function
> declaration or after the function declaration.
I tend to aggree it would be clearer to have these attributes /before/
the function prototype declaration.
> In both cases you could then
> add it to its own, separate line, avoiding a lot of noise.
>
> /Christian
>
>
>
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-20 20:42 ` Philippe Mathieu-Daudé
@ 2026-07-20 20:54 ` Philippe Mathieu-Daudé
2026-07-21 7:58 ` Marc-André Lureau
0 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 20:54 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel, Marc-André Lureau
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Greg Kurz, Michael S. Tsirkin, Stefano Stabellini,
Anthony PERARD, Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 22:42, Philippe Mathieu-Daudé wrote:
> On 20/7/26 16:02, Christian Schoenebeck wrote:
>> On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
>>> All V9fsTransport callbacks are invoked exclusively from coroutine
>>> context (the v9fs_* PDU handlers). Annotate the function pointer
>>> types in V9fsTransport and all implementations (virtio and xen
>>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>>
>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>> ---
>>> hw/9pfs/9p.h | 26 +++++++++++++++-----------
>>> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
>>> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>>> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
>>> 4 files changed, 64 insertions(+), 51 deletions(-)
>>>
>>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>>> index 1a309664f6e..0e52ffbdf38 100644
>>> --- a/hw/9pfs/9p.h
>>> +++ b/hw/9pfs/9p.h
>>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>>> void v9fs_reset(V9fsState *s);
>>>
>>>
>>> struct V9fsTransport {
>>> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
>>> char *fmt,
>>> - va_list ap);
>>> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
>>> char *fmt,
>>> - va_list ap);
>>> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>> **piov,
>>> - unsigned int *pniov, size_t
>>> size);
>>> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>> **piov,
>>> - unsigned int *pniov, size_t
>>> size);
>>> - void (*push_and_notify)(V9fsPDU *pdu);
>>> - size_t (*msize_limit)(V9fsState *s);
>>> - size_t (*response_buffer_size)(V9fsPDU *pdu);
>>> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
>>> offset,
>>> + const char *fmt,
>>> va_list ap);
>>> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
>>> offset,
>>> + const char *fmt,
>>> va_list ap);
>>> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>>> + struct iovec
>>> **piov,
>>> + unsigned int
>>> *pniov,
>>> + size_t size);
>>> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>>> + struct iovec
>>> **piov,
>>> + unsigned int
>>> *pniov,
>>> + size_t size);
>>> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>>> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
>>> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>>> };
>>
>> I wonder whether that could be made more diff/blame-friendly.
>> Especially as
>> this currently only serves documentation purposes.
>>
>> They way you are positioning coroutine_fn it usually resolves to an
>> attribute
>> attached to the function's return type, not to the function itself, even
>> though clang/gcc handling it flexible. For attaching an attribute to the
>> function itself the attribute should either be attached before the
>> function
>> declaration or after the function declaration.
>
> I tend to aggree it would be clearer to have these attributes /before/
> the function prototype declaration.
$ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
90
block/block-copy.c:47:static coroutine_fn int
block_copy_task_entry(AioTask *task);
block/copy-before-write.c:106:static coroutine_fn int
cbw_do_copy_before_write(BlockDriverState *bs,
block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
*bs)
block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
BlockDriverState *bs)
nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
block/block-copy.c:581:static coroutine_fn int
block_copy_task_entry(AioTask *task)
...
>
>> In both cases you could then
>> add it to its own, separate line, avoiding a lot of noise.
>>
>> /Christian
>>
>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls
2026-07-20 7:55 ` [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls Marc-André Lureau
@ 2026-07-20 20:57 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 20:57 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
> from non-coroutine. Remove it.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> block/qcow2-snapshot.c | 18 ------------------
> 1 file changed, 18 deletions(-)
>
> diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
> index 1e8dc48be1c..8453ad73d10 100644
> --- a/block/qcow2-snapshot.c
> +++ b/block/qcow2-snapshot.c
> @@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
> ROUND_UP(sn->vm_state_size, s->cluster_size),
> QCOW2_DISCARD_NEVER, false);
>
> -#ifdef DEBUG_ALLOC
> - {
> - BdrvCheckResult result = {0};
> - qcow2_check_refcounts(bs, &result, 0);
> - }
> -#endif
> return 0;
>
Fixes: 70bacc44532 ("qcow2: mark more functions as coroutine_fns and
GRAPH_RDLOCK")
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
While here we could remove DEBUG_ALLOC:
-- >8 --
diff --git a/block/qcow2.h b/block/qcow2.h
index ce517040c47..5e1f916d58f 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -33,3 +33,2 @@
-//#define DEBUG_ALLOC
//#define DEBUG_ALLOC2
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49..6965b80af03 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1965,9 +1965,2 @@ qcow2_do_open(BlockDriverState *bs, QDict
*options, int flags,
-#ifdef DEBUG_ALLOC
- {
- BdrvCheckResult result = {0};
- qcow2_check_refcounts(bs, &result, 0);
- }
-#endif
-
qemu_co_queue_init(&s->thread_task_queue);
---
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 6/8] block: add missing coroutine_fn annotations
2026-07-20 7:55 ` [PATCH 6/8] block: add missing coroutine_fn annotations Marc-André Lureau
@ 2026-07-20 20:58 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-20 20:58 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Christian Schoenebeck, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 20/7/26 09:55, Marc-André Lureau wrote:
> The functions call coroutine functions or are called by coroutine.
>
> Add an assert() in qcow2_do_close() code path which calls a
> no_coroutine_fn bdrv_graph_wrlock_drained().
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/block/blockjob_int.h | 2 +-
> block/crypto.c | 13 +++++++------
> block/io.c | 8 +++++---
> block/parallels.c | 5 +++--
> block/qcow2.c | 11 +++++++----
> blockjob.c | 3 ++-
> 6 files changed, 25 insertions(+), 17 deletions(-)
Too many distinct code paths in a single patch to my
taste, I'll skip.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-20 20:54 ` Philippe Mathieu-Daudé
@ 2026-07-21 7:58 ` Marc-André Lureau
2026-07-21 8:06 ` Marc-André Lureau
0 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-21 7:58 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Christian Schoenebeck, qemu-devel, Markus Armbruster, Peter Xu,
Fabiano Rosas, Daniel P. Berrangé, John Snow,
Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz, qemu-block,
Stefan Hajnoczi, Fam Zheng, Denis V. Lunev, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
Hi
On Tue, Jul 21, 2026 at 12:54 AM Philippe Mathieu-Daudé
<philmd@oss.qualcomm.com> wrote:
>
> On 20/7/26 22:42, Philippe Mathieu-Daudé wrote:
> > On 20/7/26 16:02, Christian Schoenebeck wrote:
> >> On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
> >>> All V9fsTransport callbacks are invoked exclusively from coroutine
> >>> context (the v9fs_* PDU handlers). Annotate the function pointer
> >>> types in V9fsTransport and all implementations (virtio and xen
> >>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> >>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
> >>>
> >>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>> ---
> >>> hw/9pfs/9p.h | 26 +++++++++++++++-----------
> >>> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
> >>> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
> >>> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
> >>> 4 files changed, 64 insertions(+), 51 deletions(-)
> >>>
> >>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> >>> index 1a309664f6e..0e52ffbdf38 100644
> >>> --- a/hw/9pfs/9p.h
> >>> +++ b/hw/9pfs/9p.h
> >>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
> >>> void v9fs_reset(V9fsState *s);
> >>>
> >>>
> >>> struct V9fsTransport {
> >>> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
> >>> char *fmt,
> >>> - va_list ap);
> >>> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
> >>> char *fmt,
> >>> - va_list ap);
> >>> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> >>> **piov,
> >>> - unsigned int *pniov, size_t
> >>> size);
> >>> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> >>> **piov,
> >>> - unsigned int *pniov, size_t
> >>> size);
> >>> - void (*push_and_notify)(V9fsPDU *pdu);
> >>> - size_t (*msize_limit)(V9fsState *s);
> >>> - size_t (*response_buffer_size)(V9fsPDU *pdu);
> >>> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
> >>> offset,
> >>> + const char *fmt,
> >>> va_list ap);
> >>> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
> >>> offset,
> >>> + const char *fmt,
> >>> va_list ap);
> >>> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> >>> + struct iovec
> >>> **piov,
> >>> + unsigned int
> >>> *pniov,
> >>> + size_t size);
> >>> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
> >>> + struct iovec
> >>> **piov,
> >>> + unsigned int
> >>> *pniov,
> >>> + size_t size);
> >>> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> >>> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
> >>> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
> >>> };
> >>
> >> I wonder whether that could be made more diff/blame-friendly.
> >> Especially as
> >> this currently only serves documentation purposes.
> >>
> >> They way you are positioning coroutine_fn it usually resolves to an
> >> attribute
> >> attached to the function's return type, not to the function itself, even
> >> though clang/gcc handling it flexible. For attaching an attribute to the
> >> function itself the attribute should either be attached before the
> >> function
> >> declaration or after the function declaration.
> >
> > I tend to aggree it would be clearer to have these attributes /before/
> > the function prototype declaration.
>
> $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
> 90
More like
$ git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
1343
most of them are "return-type co_annotation fn(..)"
we even have scripts/block-coroutine-wrapper.py that relies and
produce this order..
a bit late to change the style imho...
At least, let's not make this a requirement for this series, please
>> block/block-copy.c:47:static coroutine_fn int
> block_copy_task_entry(AioTask *task);
> block/copy-before-write.c:106:static coroutine_fn int
> cbw_do_copy_before_write(BlockDriverState *bs,
> block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
> *bs)
> block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
> BlockDriverState *bs)
> nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
> block/block-copy.c:581:static coroutine_fn int
> block_copy_task_entry(AioTask *task)
> ...
>
> >
> >> In both cases you could then
> >> add it to its own, separate line, avoiding a lot of noise.
> >>
> >> /Christian
> >>
> >>
> >>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-21 7:58 ` Marc-André Lureau
@ 2026-07-21 8:06 ` Marc-André Lureau
2026-07-21 8:25 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-21 8:06 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Christian Schoenebeck, qemu-devel, Markus Armbruster, Peter Xu,
Fabiano Rosas, Daniel P. Berrangé, John Snow,
Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz, qemu-block,
Stefan Hajnoczi, Fam Zheng, Denis V. Lunev, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
Hi
On Tue, Jul 21, 2026 at 11:58 AM Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi
>
> On Tue, Jul 21, 2026 at 12:54 AM Philippe Mathieu-Daudé
> <philmd@oss.qualcomm.com> wrote:
> >
> > On 20/7/26 22:42, Philippe Mathieu-Daudé wrote:
> > > On 20/7/26 16:02, Christian Schoenebeck wrote:
> > >> On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
> > >>> All V9fsTransport callbacks are invoked exclusively from coroutine
> > >>> context (the v9fs_* PDU handlers). Annotate the function pointer
> > >>> types in V9fsTransport and all implementations (virtio and xen
> > >>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> > >>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
> > >>>
> > >>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >>> ---
> > >>> hw/9pfs/9p.h | 26 +++++++++++++++-----------
> > >>> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
> > >>> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
> > >>> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
> > >>> 4 files changed, 64 insertions(+), 51 deletions(-)
> > >>>
> > >>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> > >>> index 1a309664f6e..0e52ffbdf38 100644
> > >>> --- a/hw/9pfs/9p.h
> > >>> +++ b/hw/9pfs/9p.h
> > >>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
> > >>> void v9fs_reset(V9fsState *s);
> > >>>
> > >>>
> > >>> struct V9fsTransport {
> > >>> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
> > >>> char *fmt,
> > >>> - va_list ap);
> > >>> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
> > >>> char *fmt,
> > >>> - va_list ap);
> > >>> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> > >>> **piov,
> > >>> - unsigned int *pniov, size_t
> > >>> size);
> > >>> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> > >>> **piov,
> > >>> - unsigned int *pniov, size_t
> > >>> size);
> > >>> - void (*push_and_notify)(V9fsPDU *pdu);
> > >>> - size_t (*msize_limit)(V9fsState *s);
> > >>> - size_t (*response_buffer_size)(V9fsPDU *pdu);
> > >>> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
> > >>> offset,
> > >>> + const char *fmt,
> > >>> va_list ap);
> > >>> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
> > >>> offset,
> > >>> + const char *fmt,
> > >>> va_list ap);
> > >>> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> > >>> + struct iovec
> > >>> **piov,
> > >>> + unsigned int
> > >>> *pniov,
> > >>> + size_t size);
> > >>> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
> > >>> + struct iovec
> > >>> **piov,
> > >>> + unsigned int
> > >>> *pniov,
> > >>> + size_t size);
> > >>> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> > >>> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
> > >>> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
> > >>> };
> > >>
> > >> I wonder whether that could be made more diff/blame-friendly.
> > >> Especially as
> > >> this currently only serves documentation purposes.
> > >>
> > >> They way you are positioning coroutine_fn it usually resolves to an
> > >> attribute
> > >> attached to the function's return type, not to the function itself, even
> > >> though clang/gcc handling it flexible. For attaching an attribute to the
> > >> function itself the attribute should either be attached before the
> > >> function
> > >> declaration or after the function declaration.
> > >
> > > I tend to aggree it would be clearer to have these attributes /before/
> > > the function prototype declaration.
> >
> > $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
> > 90
>
> More like
> $ git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
> 1343
>
That matching is not accurate, it's actually hard enough to match all
annotations instances.. but this should be a rough estimation.
> most of them are "return-type co_annotation fn(..)"
> we even have scripts/block-coroutine-wrapper.py that relies and
> produce this order..
> a bit late to change the style imho...
>
> At least, let's not make this a requirement for this series, please
>
> >> block/block-copy.c:47:static coroutine_fn int
> > block_copy_task_entry(AioTask *task);
> > block/copy-before-write.c:106:static coroutine_fn int
> > cbw_do_copy_before_write(BlockDriverState *bs,
> > block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
> > *bs)
> > block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
> > BlockDriverState *bs)
> > nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
> > block/block-copy.c:581:static coroutine_fn int
> > block_copy_task_entry(AioTask *task)
> > ...
> >
> > >
> > >> In both cases you could then
> > >> add it to its own, separate line, avoiding a lot of noise.
> > >>
> > >> /Christian
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> >
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-21 8:06 ` Marc-André Lureau
@ 2026-07-21 8:25 ` Philippe Mathieu-Daudé
2026-07-21 8:37 ` Christian Schoenebeck
0 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-21 8:25 UTC (permalink / raw)
To: Marc-André Lureau
Cc: Christian Schoenebeck, qemu-devel, Markus Armbruster, Peter Xu,
Fabiano Rosas, Daniel P. Berrangé, John Snow,
Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz, qemu-block,
Stefan Hajnoczi, Fam Zheng, Denis V. Lunev, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
On 21/7/26 10:06, Marc-André Lureau wrote:
> Hi
>
> On Tue, Jul 21, 2026 at 11:58 AM Marc-André Lureau
> <marcandre.lureau@redhat.com> wrote:
>>
>> Hi
>>
>> On Tue, Jul 21, 2026 at 12:54 AM Philippe Mathieu-Daudé
>> <philmd@oss.qualcomm.com> wrote:
>>>
>>> On 20/7/26 22:42, Philippe Mathieu-Daudé wrote:
>>>> On 20/7/26 16:02, Christian Schoenebeck wrote:
>>>>> On Monday, 20 July 2026 09:55:36 CEST Marc-André Lureau wrote:
>>>>>> All V9fsTransport callbacks are invoked exclusively from coroutine
>>>>>> context (the v9fs_* PDU handlers). Annotate the function pointer
>>>>>> types in V9fsTransport and all implementations (virtio and xen
>>>>>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>>>>>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>>>>>
>>>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>>> ---
>>>>>> hw/9pfs/9p.h | 26 +++++++++++++++-----------
>>>>>> hw/9pfs/9p.c | 31 +++++++++++++++++++------------
>>>>>> hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>>>>>> hw/9pfs/xen-9p-backend.c | 34 +++++++++++++++++-----------------
>>>>>> 4 files changed, 64 insertions(+), 51 deletions(-)
>>>>>>
>>>>>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>>>>>> index 1a309664f6e..0e52ffbdf38 100644
>>>>>> --- a/hw/9pfs/9p.h
>>>>>> +++ b/hw/9pfs/9p.h
>>>>>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>>>>>> void v9fs_reset(V9fsState *s);
>>>>>>
>>>>>>
>>>>>> struct V9fsTransport {
>>>>>> - ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
>>>>>> char *fmt,
>>>>>> - va_list ap);
>>>>>> - ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
>>>>>> char *fmt,
>>>>>> - va_list ap);
>>>>>> - void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>>>>> **piov,
>>>>>> - unsigned int *pniov, size_t
>>>>>> size);
>>>>>> - void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>>>>> **piov,
>>>>>> - unsigned int *pniov, size_t
>>>>>> size);
>>>>>> - void (*push_and_notify)(V9fsPDU *pdu);
>>>>>> - size_t (*msize_limit)(V9fsState *s);
>>>>>> - size_t (*response_buffer_size)(V9fsPDU *pdu);
>>>>>> + ssize_t coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
>>>>>> offset,
>>>>>> + const char *fmt,
>>>>>> va_list ap);
>>>>>> + ssize_t coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
>>>>>> offset,
>>>>>> + const char *fmt,
>>>>>> va_list ap);
>>>>>> + void coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>>>>>> + struct iovec
>>>>>> **piov,
>>>>>> + unsigned int
>>>>>> *pniov,
>>>>>> + size_t size);
>>>>>> + void coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>>>>>> + struct iovec
>>>>>> **piov,
>>>>>> + unsigned int
>>>>>> *pniov,
>>>>>> + size_t size);
>>>>>> + void coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>>>>>> + size_t coroutine_fn (*msize_limit)(V9fsState *s);
>>>>>> + size_t coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>>>>>> };
>>>>>
>>>>> I wonder whether that could be made more diff/blame-friendly.
>>>>> Especially as
>>>>> this currently only serves documentation purposes.
>>>>>
>>>>> They way you are positioning coroutine_fn it usually resolves to an
>>>>> attribute
>>>>> attached to the function's return type, not to the function itself, even
>>>>> though clang/gcc handling it flexible. For attaching an attribute to the
>>>>> function itself the attribute should either be attached before the
>>>>> function
>>>>> declaration or after the function declaration.
>>>>
>>>> I tend to aggree it would be clearer to have these attributes /before/
>>>> the function prototype declaration.
>>>
>>> $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
>>> 90
>>
>> More like
>> $ git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
>> 1343
>>
>
> That matching is not accurate, it's actually hard enough to match all
> annotations instances.. but this should be a rough estimation.
>
>> most of them are "return-type co_annotation fn(..)"
>> we even have scripts/block-coroutine-wrapper.py that relies and
>> produce this order..
>> a bit late to change the style imho...
>>
>> At least, let's not make this a requirement for this series, please
Not a requirement on my side, but if we had to pick a style,
I'd vote for "attribute before return type".
>>
>>>> block/block-copy.c:47:static coroutine_fn int
>>> block_copy_task_entry(AioTask *task);
>>> block/copy-before-write.c:106:static coroutine_fn int
>>> cbw_do_copy_before_write(BlockDriverState *bs,
>>> block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
>>> *bs)
>>> block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
>>> BlockDriverState *bs)
>>> nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
>>> block/block-copy.c:581:static coroutine_fn int
>>> block_copy_task_entry(AioTask *task)
>>> ...
>>>
>>>>
>>>>> In both cases you could then
>>>>> add it to its own, separate line, avoiding a lot of noise.
>>>>>
>>>>> /Christian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-21 8:25 ` Philippe Mathieu-Daudé
@ 2026-07-21 8:37 ` Christian Schoenebeck
2026-07-21 8:39 ` Marc-André Lureau
0 siblings, 1 reply; 27+ messages in thread
From: Christian Schoenebeck @ 2026-07-21 8:37 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel, Philippe Mathieu-Daudé
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Greg Kurz, Michael S. Tsirkin, Stefano Stabellini,
Anthony PERARD, Edgar E. Iglesias, xen-devel, Li Zhijian
On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daudé wrote:
> On 21/7/26 10:06, Marc-André Lureau wrote:
> > Hi
> >
> > On Tue, Jul 21, 2026 at 11:58 AM Marc-André Lureau
> >
> > <marcandre.lureau@redhat.com> wrote:
[...]
> >> most of them are "return-type co_annotation fn(..)"
> >> we even have scripts/block-coroutine-wrapper.py that relies and
> >> produce this order..
> >> a bit late to change the style imho...
> >>
> >> At least, let's not make this a requirement for this series, please
>
> Not a requirement on my side, but if we had to pick a style,
> I'd vote for "attribute before return type".
Yep, because that's a) the most compiler-friendly option (all compilers allow
it, including MSC) and b) it's the most diff-noise friendly solution (can be
prepended on its own line without touching any of the existing line(s) at
all).
/Christian
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-21 8:37 ` Christian Schoenebeck
@ 2026-07-21 8:39 ` Marc-André Lureau
2026-07-21 8:50 ` Christian Schoenebeck
0 siblings, 1 reply; 27+ messages in thread
From: Marc-André Lureau @ 2026-07-21 8:39 UTC (permalink / raw)
To: Christian Schoenebeck
Cc: qemu-devel, Philippe Mathieu-Daudé, Markus Armbruster,
Peter Xu, Fabiano Rosas, Daniel P. Berrangé, John Snow,
Vladimir Sementsov-Ogievskiy, Kevin Wolf, Hanna Reitz, qemu-block,
Stefan Hajnoczi, Fam Zheng, Denis V. Lunev, Greg Kurz,
Michael S. Tsirkin, Stefano Stabellini, Anthony PERARD,
Edgar E. Iglesias, xen-devel, Li Zhijian
Hi
On Tue, Jul 21, 2026 at 12:38 PM Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daudé wrote:
> > On 21/7/26 10:06, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Tue, Jul 21, 2026 at 11:58 AM Marc-André Lureau
> > >
> > > <marcandre.lureau@redhat.com> wrote:
> [...]
> > >> most of them are "return-type co_annotation fn(..)"
> > >> we even have scripts/block-coroutine-wrapper.py that relies and
> > >> produce this order..
> > >> a bit late to change the style imho...
> > >>
> > >> At least, let's not make this a requirement for this series, please
> >
> > Not a requirement on my side, but if we had to pick a style,
> > I'd vote for "attribute before return type".
>
> Yep, because that's a) the most compiler-friendly option (all compilers allow
> it, including MSC) and b) it's the most diff-noise friendly solution (can be
> prepended on its own line without touching any of the existing line(s) at
> all).
>
ok, what should I do? Send a preliminary patch to fix all annotation
positions? or just change the position in this patch or series?
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
2026-07-21 8:39 ` Marc-André Lureau
@ 2026-07-21 8:50 ` Christian Schoenebeck
0 siblings, 0 replies; 27+ messages in thread
From: Christian Schoenebeck @ 2026-07-21 8:50 UTC (permalink / raw)
To: qemu-devel, Philippe Mathieu-Daudé, Marc-André Lureau
Cc: Markus Armbruster, Peter Xu, Fabiano Rosas,
Daniel P. Berrangé, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, qemu-block, Stefan Hajnoczi, Fam Zheng,
Denis V. Lunev, Greg Kurz, Michael S. Tsirkin, Stefano Stabellini,
Anthony PERARD, Edgar E. Iglesias, xen-devel, Li Zhijian
On Tuesday, 21 July 2026 10:39:52 CEST Marc-André Lureau wrote:
> Hi
>
> On Tue, Jul 21, 2026 at 12:38 PM Christian Schoenebeck
>
> <qemu_oss@crudebyte.com> wrote:
> > On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daudé wrote:
> > > On 21/7/26 10:06, Marc-André Lureau wrote:
> > > > Hi
> > > >
> > > > On Tue, Jul 21, 2026 at 11:58 AM Marc-André Lureau
> >
> > > > <marcandre.lureau@redhat.com> wrote:
> > [...]
> >
> > > >> most of them are "return-type co_annotation fn(..)"
> > > >> we even have scripts/block-coroutine-wrapper.py that relies and
> > > >> produce this order..
> > > >> a bit late to change the style imho...
> > > >>
> > > >> At least, let's not make this a requirement for this series, please
> > >
> > > Not a requirement on my side, but if we had to pick a style,
> > > I'd vote for "attribute before return type".
> >
> > Yep, because that's a) the most compiler-friendly option (all compilers
> > allow it, including MSC) and b) it's the most diff-noise friendly
> > solution (can be prepended on its own line without touching any of the
> > existing line(s) at all).
>
> ok, what should I do? Send a preliminary patch to fix all annotation
> positions? or just change the position in this patch or series?
Your decision. I'm just giving my 2cts. As this is not a behaviour change, it
is way below my threshold level for taking any strong position. If you can
make this for this patch for now, that would nice, but if not, not a deal
breaker either:
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2026-07-21 8:51 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
2026-07-20 7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
2026-07-20 12:34 ` Markus Armbruster
2026-07-20 14:26 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
2026-07-20 14:09 ` Peter Xu
2026-07-20 14:27 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 3/8] io: add missing coroutine annotation Marc-André Lureau
2026-07-20 14:28 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 4/8] block: " Marc-André Lureau
2026-07-20 14:28 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls Marc-André Lureau
2026-07-20 20:57 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 6/8] block: add missing coroutine_fn annotations Marc-André Lureau
2026-07-20 20:58 ` Philippe Mathieu-Daudé
2026-07-20 7:55 ` [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn Marc-André Lureau
2026-07-20 14:02 ` Christian Schoenebeck
2026-07-20 20:42 ` Philippe Mathieu-Daudé
2026-07-20 20:54 ` Philippe Mathieu-Daudé
2026-07-21 7:58 ` Marc-André Lureau
2026-07-21 8:06 ` Marc-André Lureau
2026-07-21 8:25 ` Philippe Mathieu-Daudé
2026-07-21 8:37 ` Christian Schoenebeck
2026-07-21 8:39 ` Marc-André Lureau
2026-07-21 8:50 ` Christian Schoenebeck
2026-07-20 7:55 ` [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel() Marc-André Lureau
2026-07-20 14:13 ` Peter Xu
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.