[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations
From: |
Kevin Wolf |
Subject: |
Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations |
Date: |
Thu, 3 Nov 2022 19:06:53 +0100 |
Am 03.11.2022 um 17:56 hat Paolo Bonzini geschrieben:
> On 11/3/22 14:41, Emanuele Giuseppe Esposito wrote:
> > block_copy_reset_unallocated and block_copy_is_cluster_allocated are
> > only called by backup_run, a corotuine_fn itself.
s/corotuine_fn/coroutine_fn/
> >
> > Same applies to block_copy_block_status, called by
> > block_copy_dirty_clusters.
> >
> > Therefore mark them as coroutine too.
> >
> > Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
>
> They don't need to be coroutine_fn. coroutine_fn is needed if you call
> another coroutine_fn, but not if you _are only called_ by coroutine_fn.
> There is nothing in these functions that needs them to be called from a
> coroutine.
>
> The only exception is qemu_coroutine_yield(), which is the only leaf
> coroutine_fn.
I think it can make sense to have coroutine_fn as a documentation for
things that are only ever called in a coroutine even if they could
theoretically also work outside of coroutine context.
Otherwise, when we want to introduce a coroutine_fn call somewhere, it's
not only less obvious that it's even possible to do, but we'll have to
add potentially many additional coroutine_fn annotations in the whole
call chain in an otherwise unrelated patch.
Kevin
- [PATCH 5/9] block: distinguish between bdrv_create running in coroutine and not, (continued)
- [PATCH 5/9] block: distinguish between bdrv_create running in coroutine and not, Emanuele Giuseppe Esposito, 2022/11/03
- [PATCH 4/9] block-backend: replace bdrv_*_above with blk_*_above, Emanuele Giuseppe Esposito, 2022/11/03
- [PATCH 7/9] block: bdrv_create_file is a coroutine_fn, Emanuele Giuseppe Esposito, 2022/11/03
- [PATCH 3/9] nbd/server.c: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/03
- [PATCH 8/9] block: bdrv_create is never called in non-coroutine context, Emanuele Giuseppe Esposito, 2022/11/03
- [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/03
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/03
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations,
Kevin Wolf <=
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/03
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/04
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/04
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/04
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/04
- Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations, Kevin Wolf, 2022/11/04
[PATCH 6/9] block/vmdk: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/03
[PATCH 9/9] block/dirty-bitmap: remove unnecessary qemu_in_coroutine() case, Emanuele Giuseppe Esposito, 2022/11/03