Re: [PATCH 07/21] block-coroutine-wrapper: Allow arbitrary parameter names

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:06PM +0200, Kevin Wolf wrote:
> Don't assume specific parameter names like 'bs' or 'blk' in the
> generated code, but use the actual name.
> 
> Signed-off-by: Kevin Wolf 
> ---
>  scripts/block-coroutine-wrapper.py | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Stefan Hajnoczi 


signature.asc
Description: PGP signature


Re: [PATCH 07/21] block-coroutine-wrapper: Allow arbitrary parameter names

2023-08-21 Thread Emanuele Giuseppe Esposito



Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> Don't assume specific parameter names like 'bs' or 'blk' in the
> generated code, but use the actual name.
> 
> Signed-off-by: Kevin Wolf 

Reviewed-by: Emanuele Giuseppe Esposito 




[PATCH 07/21] block-coroutine-wrapper: Allow arbitrary parameter names

2023-08-17 Thread Kevin Wolf
Don't assume specific parameter names like 'bs' or 'blk' in the
generated code, but use the actual name.

Signed-off-by: Kevin Wolf 
---
 scripts/block-coroutine-wrapper.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/block-coroutine-wrapper.py 
b/scripts/block-coroutine-wrapper.py
index fa01c06567..685d0b4ed4 100644
--- a/scripts/block-coroutine-wrapper.py
+++ b/scripts/block-coroutine-wrapper.py
@@ -105,12 +105,13 @@ def __init__(self, wrapper_type: str, return_type: str, 
name: str,
 
 def gen_ctx(self, prefix: str = '') -> str:
 t = self.args[0].type
+name = self.args[0].name
 if t == 'BlockDriverState *':
-return f'bdrv_get_aio_context({prefix}bs)'
+return f'bdrv_get_aio_context({prefix}{name})'
 elif t == 'BdrvChild *':
-return f'bdrv_get_aio_context({prefix}child->bs)'
+return f'bdrv_get_aio_context({prefix}{name}->bs)'
 elif t == 'BlockBackend *':
-return f'blk_get_aio_context({prefix}blk)'
+return f'blk_get_aio_context({prefix}{name})'
 else:
 return 'qemu_get_aio_context()'
 
-- 
2.41.0