qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 13/35] nbd: mark coroutine_fn
Date: Thu, 6 Jul 2017 09:33:18 -0500	[thread overview]
Message-ID: <b4fae9ff-ee50-c4b6-f3ee-2a3157c0fc6a@redhat.com> (raw)
In-Reply-To: <20170704220346.29244-14-marcandre.lureau@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3661 bytes --]

On 07/04/2017 05:03 PM, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  block/nbd-client.h | 10 +++++-----
>  block/nbd-client.c | 24 ++++++++++++++++--------
>  block/nbd.c        |  3 ++-
>  nbd/server.c       |  3 ++-
>  4 files changed, 25 insertions(+), 15 deletions(-)
> 

> diff --git a/block/nbd-client.h b/block/nbd-client.h
> index 49636bc621..473d1f88fd 100644
> --- a/block/nbd-client.h
> +++ b/block/nbd-client.h
> @@ -42,13 +42,13 @@ int nbd_client_init(BlockDriverState *bs,
>                      Error **errp);
>  void nbd_client_close(BlockDriverState *bs);
>  
> -int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes);
> -int nbd_client_co_flush(BlockDriverState *bs);
> -int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset,
> +int coroutine_fn nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes);
> +int coroutine_fn nbd_client_co_flush(BlockDriverState *bs);
> +int coroutine_fn nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset,
>                            uint64_t bytes, QEMUIOVector *qiov, int flags);

Indentation is off.

> -int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,
> +int coroutine_fn nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,
>                                  int bytes, BdrvRequestFlags flags);
> -int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset,
> +int coroutine_fn nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset,
>                           uint64_t bytes, QEMUIOVector *qiov, int flags);
>  

and some more

>  void nbd_client_detach_aio_context(BlockDriverState *bs);
> diff --git a/block/nbd-client.c b/block/nbd-client.c
> index 02e928142e..63c0210c37 100644
> --- a/block/nbd-client.c
> +++ b/block/nbd-client.c
> @@ -111,7 +111,8 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque)
>      s->read_reply_co = NULL;
>  }
>  
> -static int nbd_co_send_request(BlockDriverState *bs,
> +static int coroutine_fn
> +nbd_co_send_request(BlockDriverState *bs,
>                                 NBDRequest *request,
>                                 QEMUIOVector *qiov)
>  {

I know some project specifically like the newline between return type
and function name (it becomes easier to search for function
implementations if ALL function names start in the first column), but it
looks a bit odd compared to the usual qemu style.  I guess you did it
for line length reasons.  But once you do it, now the indentation is off
on the remaining parameters.

> @@ -158,7 +159,8 @@ static int nbd_co_send_request(BlockDriverState *bs,
>      return rc;
>  }
>  
> -static void nbd_co_receive_reply(NBDClientSession *s,
> +static void coroutine_fn
> +nbd_co_receive_reply(NBDClientSession *s,
>                                   NBDRequest *request,
>                                   NBDReply *reply,
>                                   QEMUIOVector *qiov)

Recurring theme of whitespace.

> @@ -185,7 +187,8 @@ static void nbd_co_receive_reply(NBDClientSession *s,
>      }
>  }
>  
> -static void nbd_coroutine_end(BlockDriverState *bs,
> +static void coroutine_fn
> +nbd_coroutine_end(BlockDriverState *bs,
>                                NBDRequest *request)

This even fits on one line now.

Whitespace fixes are trivial enough, so I'm still okay if you add:

Reviewed-by: Eric Blake <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-07-06 14:33 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 22:03 [Qemu-devel] [PATCH 00/35] RFC: coroutine annotations & clang check Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 01/35] WIP: coroutine: annotate coroutine with clang thread safety attributes Marc-André Lureau
2017-07-05 11:39   ` Paolo Bonzini
2017-07-05 14:11     ` Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 02/35] WIP: coroutine: manually tag the fast-paths Marc-André Lureau
2017-07-11 15:23   ` Stefan Hajnoczi
2017-07-11 15:41     ` Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 03/35] test-coroutine: fix coroutine attribute Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 04/35] coroutine: remove coroutine_fn from qemu_coroutine_self() Marc-André Lureau
2017-07-05 10:56   ` Paolo Bonzini
2017-07-05 13:39     ` Marc-André Lureau
2017-07-05 13:43       ` Paolo Bonzini
2017-07-04 22:03 ` [Qemu-devel] [PATCH 05/35] coroutine: remove coroutine_fn from qemu_co_queue_run_restart() Marc-André Lureau
2017-07-11 15:26   ` Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 06/35] coroutine: mark CoRwLock coroutine_fn Marc-André Lureau
2017-07-11 15:26   ` Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 07/35] blockjob: mark coroutine_fn Marc-André Lureau
2017-07-11 15:27   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn Marc-André Lureau
2017-07-05 10:53   ` Paolo Bonzini
2017-07-05 14:21     ` Marc-André Lureau
2017-07-05 14:44       ` Paolo Bonzini
2017-07-05 16:06         ` Marc-André Lureau
2017-07-05 16:10           ` Paolo Bonzini
2017-07-05 16:40             ` Marc-André Lureau
2017-07-05 16:42               ` Paolo Bonzini
2017-07-04 22:03 ` [Qemu-devel] [PATCH 09/35] block: bdrv_create() and bdrv_debug_event() " Marc-André Lureau
2017-07-11 16:04   ` Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 10/35] vmdk: mark coroutine_fn Marc-André Lureau
2017-07-11 16:04   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 11/35] qcow2: " Marc-André Lureau
2017-07-11 16:04   ` Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 12/35] raw: " Marc-André Lureau
2017-07-11 16:06   ` Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 13/35] nbd: " Marc-André Lureau
2017-07-06 14:33   ` Eric Blake [this message]
2017-07-04 22:03 ` [Qemu-devel] [PATCH 14/35] migration: " Marc-André Lureau
2017-07-11 16:06   ` Stefan Hajnoczi
2017-07-18 16:04   ` Juan Quintela
2017-07-18 16:21     ` Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 15/35] backup: " Marc-André Lureau
2017-07-11 18:53   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-07-04 22:03 ` [Qemu-devel] [PATCH 16/35] crypto: " Marc-André Lureau
2017-07-18 19:27   ` Eric Blake
2017-07-04 22:03 ` [Qemu-devel] [PATCH 17/35] curl: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 18/35] gluster: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 19/35] nfs: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 20/35] quorum: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 21/35] rbd: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 22/35] sheepdog: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 23/35] ssh: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 24/35] null: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 25/35] mirror: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 26/35] iscsi: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 27/35] file-posix: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 28/35] 9p: " Marc-André Lureau
2017-07-05  9:45   ` Greg Kurz
2017-07-04 22:03 ` [Qemu-devel] [PATCH 29/35] block: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 30/35] block-backend: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 31/35] parallels: " Marc-André Lureau
2017-07-05 14:11   ` Denis V. Lunev
2017-07-04 22:03 ` [Qemu-devel] [PATCH 32/35] qed: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 33/35] vdi: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 34/35] vhdx: " Marc-André Lureau
2017-07-04 22:03 ` [Qemu-devel] [PATCH 35/35] vpc: " Marc-André Lureau
2017-07-05  5:25 ` [Qemu-devel] [PATCH 00/35] RFC: coroutine annotations & clang check Markus Armbruster
2017-07-05  9:34   ` Marc-André Lureau

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=b4fae9ff-ee50-c4b6-f3ee-2a3157c0fc6a@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@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).