Re: [PATCH 13/26] parallels: add missing coroutine_fn annotations

2022-10-05 Thread Kevin Wolf
Am 22.09.2022 um 10:49 hat Paolo Bonzini geschrieben:
> 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.
> 
> Reviewed-by: Alberto Faria 
> Signed-off-by: Paolo Bonzini 
> ---
>  block/parallels.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/block/parallels.c b/block/parallels.c
> index a229c06f25..5fc726f446 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c
> @@ -165,8 +165,9 @@ static int64_t block_status(BDRVParallelsState *s, 
> int64_t sector_num,
>  return start_off;
>  }
>  
> -static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
> - int nb_sectors, int *pnum)
> +static coroutine_fn int64_t allocate_clusters(BlockDriverState *bs,
> +   int64_t sector_num,
> +   int nb_sectors, int *pnum)

Indentation with spaces instead of tabs for QEMU, please.

Kevin

>  {
>  int ret = 0;
>  BDRVParallelsState *s = bs->opaque;
> -- 
> 2.37.3
> 




[PATCH 13/26] parallels: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
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.

Reviewed-by: Alberto Faria 
Signed-off-by: Paolo Bonzini 
---
 block/parallels.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/parallels.c b/block/parallels.c
index a229c06f25..5fc726f446 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -165,8 +165,9 @@ static int64_t block_status(BDRVParallelsState *s, int64_t 
sector_num,
 return start_off;
 }
 
-static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
- int nb_sectors, int *pnum)
+static coroutine_fn int64_t allocate_clusters(BlockDriverState *bs,
+ int64_t sector_num,
+ int nb_sectors, int *pnum)
 {
 int ret = 0;
 BDRVParallelsState *s = bs->opaque;
-- 
2.37.3




[PATCH 13/26] parallels: add missing coroutine_fn annotations

2022-04-15 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini 
---
 block/parallels.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/parallels.c b/block/parallels.c
index 8879b7027a..bee2ff023d 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -165,8 +165,9 @@ static int64_t block_status(BDRVParallelsState *s, int64_t 
sector_num,
 return start_off;
 }
 
-static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
- int nb_sectors, int *pnum)
+static coroutine_fn int64_t allocate_clusters(BlockDriverState *bs,
+ int64_t sector_num,
+ int nb_sectors, int *pnum)
 {
 int ret = 0;
 BDRVParallelsState *s = bs->opaque;
-- 
2.35.1