qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 4/9] nbd: mark more coroutine_fns, do not use co_wrappers
Date: Thu, 9 Mar 2023 09:40:25 -0600	[thread overview]
Message-ID: <20230309154025.gadhwqel253khpg5@redhat.com> (raw)
In-Reply-To: <20230309084456.304669-5-pbonzini@redhat.com>

On Thu, Mar 09, 2023 at 09:44:51AM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  nbd/server.c | 48 ++++++++++++++++++++++++------------------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/nbd/server.c b/nbd/server.c
> index a4750e41880a..6f5fcade2a54 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -1409,8 +1409,8 @@ nbd_read_eof(NBDClient *client, void *buffer, size_t size, Error **errp)
>      return 1;
>  }
>  
> -static int nbd_receive_request(NBDClient *client, NBDRequest *request,
> -                               Error **errp)
> +static int coroutine_fn nbd_receive_request(NBDClient *client, NBDRequest *request,
> +                                            Error **errp)
>  {

Should we rename this nbd_co_receive_request() while at it?

...
> @@ -2198,9 +2198,9 @@ static int coroutine_fn blockalloc_to_extents(BlockBackend *blk,
>   * @ea is converted to BE by the function
>   * @last controls whether NBD_REPLY_FLAG_DONE is sent.
>   */
> -static int nbd_co_send_extents(NBDClient *client, uint64_t handle,
> -                               NBDExtentArray *ea,
> -                               bool last, uint32_t context_id, Error **errp)
> +static int coroutine_fn nbd_co_send_extents(NBDClient *client, uint64_t handle,
> +                                            NBDExtentArray *ea,
> +                               bool              last, uint32_t context_id, Error **errp)

Whitespace damage.

...
> @@ -2297,8 +2297,8 @@ static int nbd_co_send_bitmap(NBDClient *client, uint64_t handle,
>   * to the client (although the caller may still need to disconnect after
>   * reporting the error).
>   */
> -static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request,
> -                                  Error **errp)
> +static int coroutine_fn nbd_co_receive_request(NBDRequestData *req, NBDRequest *request,
> +                                               Error **errp)
>  {
>      NBDClient *client = req->client;
>      int valid_flags;
> @@ -2446,7 +2446,7 @@ static coroutine_fn int nbd_do_cmd_read(NBDClient *client, NBDRequest *request,

Most uses of coroutine_fn in this patch occur after the return type,
but in this and later hunks, the function has it the other way around.
Should we touch that up in this patch?  Likewise, should we add _co_
in the name of these pre-existing coroutine_fn functions
nbd_do_cmd_read and nbd_handle_request?

But I'm liking the efforts to use our annotations more consistently,
particularly if it is a result of you making progress on having the
compiler point out inconsistencies.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2023-03-09 15:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  8:44 [PATCH 0/9] (mostly) block: add more coroutine_fn annotations, use bdrv/blk_co_* Paolo Bonzini
2023-03-09  8:44 ` [PATCH 1/9] vvfat: mark various functions as coroutine_fn Paolo Bonzini
2023-03-09  8:44 ` [PATCH 2/9] blkdebug: add missing coroutine_fn annotation Paolo Bonzini
2023-03-09  8:44 ` [PATCH 3/9] mirror: make mirror_flush a coroutine_fn, do not use co_wrappers Paolo Bonzini
2023-03-09  8:44 ` [PATCH 4/9] nbd: mark more coroutine_fns, " Paolo Bonzini
2023-03-09 15:40   ` Eric Blake [this message]
2023-03-09  8:44 ` [PATCH 5/9] 9pfs: mark more coroutine_fns Paolo Bonzini
2023-03-09  9:23   ` Christian Schoenebeck
2023-03-09  8:44 ` [PATCH 6/9] qemu-pr-helper: " Paolo Bonzini
2023-03-09  8:44 ` [PATCH 7/9] tests: " Paolo Bonzini
2023-03-09  8:44 ` [PATCH 8/9] qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK Paolo Bonzini
2023-03-09  8:44 ` [PATCH 9/9] vmdk: make vmdk_is_cid_valid a coroutine_fn Paolo Bonzini
2023-03-23 15:02 ` [PATCH 0/9] (mostly) block: add more coroutine_fn annotations, use bdrv/blk_co_* Kevin Wolf

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=20230309154025.gadhwqel253khpg5@redhat.com \
    --to=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).