Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-04 Thread Paolo Bonzini
On 11/4/22 10:20, Emanuele Giuseppe Esposito wrote: At this point I just want to make sure that we agree that it's correct to add coroutine_fn because of "the function calls a g_c_w that suspends" *&&* "all the callers are coroutine_fn". If the callers weren't coroutine_fn then g_c_w would just c

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-04 Thread Kevin Wolf
Am 04.11.2022 um 09:44 hat Paolo Bonzini geschrieben: > On 11/4/22 08:35, Emanuele Giuseppe Esposito wrote: > > But isn't it a bug also not to mark a function _only_ called by > > coroutine_fn? My point is that if this function is an implementation of > > a BlockDriver callback marked as coroutine_

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-04 Thread Emanuele Giuseppe Esposito
Am 04/11/2022 um 09:44 schrieb Paolo Bonzini: > On 11/4/22 08:35, Emanuele Giuseppe Esposito wrote: >> But isn't it a bug also not to mark a function _only_ called by >> coroutine_fn? My point is that if this function is an implementation of >> a BlockDriver callback marked as coroutine_fn (like

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-04 Thread Paolo Bonzini
On 11/4/22 08:35, Emanuele Giuseppe Esposito wrote: But isn't it a bug also not to mark a function _only_ called by coroutine_fn? My point is that if this function is an implementation of a BlockDriver callback marked as coroutine_fn (like in patch 6 with vmdk), then it would make sense. If a f

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-04 Thread Emanuele Giuseppe Esposito
Am 03/11/2022 um 19:36 schrieb Paolo Bonzini: > On 11/3/22 19:06, Kevin Wolf wrote: >> 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. >> >> Otherw

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
On 11/3/22 19:06, Kevin Wolf wrote: 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, i

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Kevin Wolf
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_co

Re: [PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Paolo Bonzini
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. Same applies to block_copy_block_status, called by block_copy_dirty_clusters. Therefore mark them as coroutine too. Signed-

[PATCH 2/9] block-copy: add missing coroutine_fn annotations

2022-11-03 Thread Emanuele Giuseppe Esposito
block_copy_reset_unallocated and block_copy_is_cluster_allocated are only called by backup_run, a corotuine_fn itself. 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 --- block/block-c