[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/21] block-coroutine-wrapper: Allow arbitrary parameter name
From: |
Kevin Wolf |
Subject: |
[PATCH v2 07/21] block-coroutine-wrapper: Allow arbitrary parameter names |
Date: |
Mon, 11 Sep 2023 11:46:06 +0200 |
Don't assume specific parameter names like 'bs' or 'blk' in the
generated code, but use the actual name.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
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
- [PATCH v2 00/21] Graph locking part 4 (node management), Kevin Wolf, 2023/09/11
- [PATCH v2 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked, Kevin Wolf, 2023/09/11
- [PATCH v2 02/21] preallocate: Factor out preallocate_truncate_to_real_size(), Kevin Wolf, 2023/09/11
- [PATCH v2 03/21] preallocate: Don't poll during permission updates, Kevin Wolf, 2023/09/11
- [PATCH v2 06/21] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions, Kevin Wolf, 2023/09/11
- [PATCH v2 07/21] block-coroutine-wrapper: Allow arbitrary parameter names,
Kevin Wolf <=
- [PATCH v2 04/21] block: Take AioContext lock for bdrv_append() more consistently, Kevin Wolf, 2023/09/11
- [PATCH v2 05/21] block: Introduce bdrv_schedule_unref(), Kevin Wolf, 2023/09/11
- [PATCH v2 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK, Kevin Wolf, 2023/09/11
- [PATCH v2 08/21] block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK, Kevin Wolf, 2023/09/11
- [PATCH v2 11/21] block: Call transaction callbacks with lock held, Kevin Wolf, 2023/09/11
- [PATCH v2 12/21] block: Mark bdrv_attach_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/11
- [PATCH v2 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK, Kevin Wolf, 2023/09/11
- [PATCH v2 14/21] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/09/11
- [PATCH v2 15/21] block: Mark bdrv_child_perm() GRAPH_RDLOCK, Kevin Wolf, 2023/09/11