[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/26] block: add missing coroutine_fn annotations
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 02/26] block: add missing coroutine_fn annotations |
Date: |
Sat, 24 Sep 2022 15:41:53 +0200 |
On Thu, Sep 22, 2022 at 5:12 PM Alberto Campinho Faria
<afaria@redhat.com> wrote:
>
> On Thu, Sep 22, 2022 at 9:49 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Callers of coroutine_fn must be coroutine_fn themselves, or the call
> > must be within "if (qemu_in_coroutine())". Apply coroutine_fn to
> > functions where this holds.
> >
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> > block.c | 6 +++---
> > block/block-backend.c | 10 +++++-----
> > block/io.c | 22 +++++++++++-----------
> > 3 files changed, 19 insertions(+), 19 deletions(-)
> >
> > diff --git a/block.c b/block.c
> > index bc85f46eed..5c34ada53f 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -631,9 +631,9 @@ static int64_t
> > create_file_fallback_truncate(BlockBackend *blk,
> > * Helper function for bdrv_create_file_fallback(): Zero the first
> > * sector to remove any potentially pre-existing image header.
> > */
> > -static int create_file_fallback_zero_first_sector(BlockBackend *blk,
> > - int64_t current_size,
> > - Error **errp)
> > +static int coroutine_fn
> > create_file_fallback_zero_first_sector(BlockBackend *blk,
> > + int64_t
> > current_size,
> > + Error
> > **errp)
>
> Why mark this coroutine_fn? Maybe the intention was to also replace
> the call to blk_pwrite_zeroes() with blk_co_pwrite_zeroes()?
Because at the time I wrote the patch, blk_pwrite_zeroes() was a
coroutine_fn. :)
It is called from bdrv_co_create_opts_simple which is coroutine_fn and
performs I/O, so it should be a coroutine_fn. I have a few more patches
to not go through the generated_co_wrappers, but I was curious to see
if we could automate those changes through your tool.
Paolo
>
> Regardless:
>
> Reviewed-by: Alberto Faria <afaria@redhat.com>
>
- [PATCH v3 00/26] block: fix coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 02/26] block: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 01/26] block/nvme: separate nvme_get_free_req cases for coroutine/non-coroutine context, Paolo Bonzini, 2022/09/22
- [PATCH 11/26] nfs: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 03/26] qcow2: remove incorrect coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 06/26] blkdebug: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 05/26] coroutine: remove incorrect coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 07/26] blkverify: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 10/26] nbd: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 08/26] file-posix: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 09/26] iscsi: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 15/26] copy-before-write: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22