From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org, "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Peter Xu" <peterx@redhat.com>, "Fabiano Rosas" <farosas@suse.de>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
qemu-block@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
"Fam Zheng" <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
"Greg Kurz" <groug@kaod.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony@xenproject.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
xen-devel@lists.xenproject.org,
"Li Zhijian" <lizhijian@fujitsu.com>
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
Date: Mon, 20 Jul 2026 16:02:47 +0200 [thread overview]
Message-ID: <7970030.EvYhyI6sBW@weasel> (raw)
In-Reply-To: <20260720-co-v1-7-fabb4db3c204@redhat.com>
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
next prev parent reply other threads:[~2026-07-20 14:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-07-20 20:42 ` Philippe Mathieu-Daudé
2026-07-20 20:54 ` Philippe Mathieu-Daudé
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
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=7970030.EvYhyI6sBW@weasel \
--to=qemu_oss@crudebyte.com \
--cc=anthony@xenproject.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den@openvz.org \
--cc=edgar.iglesias@gmail.com \
--cc=fam@euphon.net \
--cc=farosas@suse.de \
--cc=groug@kaod.org \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=lizhijian@fujitsu.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@yandex-team.ru \
--cc=xen-devel@lists.xenproject.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 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.