[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/28] block-coroutine-wrapper: Allow arbitrary parameter names
From: |
Kevin Wolf |
Subject: |
[PULL 07/28] block-coroutine-wrapper: Allow arbitrary parameter names |
Date: |
Fri, 15 Sep 2023 16:43:23 +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>
Message-ID: <20230911094620.45040-8-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@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
- [PULL 06/28] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions, (continued)
- [PULL 06/28] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions, Kevin Wolf, 2023/09/15
- [PULL 14/28] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/09/15
- [PULL 15/28] block: Mark bdrv_child_perm() GRAPH_RDLOCK, Kevin Wolf, 2023/09/15
- [PULL 17/28] block: Take graph rdlock in bdrv_drop_intermediate(), Kevin Wolf, 2023/09/15
- [PULL 08/28] block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 22/28] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status(), Kevin Wolf, 2023/09/15
- [PULL 23/28] qemu-img: map: report compressed data blocks, Kevin Wolf, 2023/09/15
- [PULL 27/28] block-backend: process zoned requests in the current AioContext, Kevin Wolf, 2023/09/15
- [PULL 26/28] block-backend: process I/O in the current AioContext, Kevin Wolf, 2023/09/15
- [PULL 12/28] block: Mark bdrv_attach_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 07/28] block-coroutine-wrapper: Allow arbitrary parameter names,
Kevin Wolf <=
- [PULL 11/28] block: Call transaction callbacks with lock held, Kevin Wolf, 2023/09/15
- [PULL 13/28] block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/09/15
- [PULL 18/28] block: Take graph rdlock in bdrv_change_aio_context(), Kevin Wolf, 2023/09/15
- [PULL 19/28] block: Mark bdrv_root_unref_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 25/28] test-bdrv-drain: avoid race with BH in IOThread drain test, Kevin Wolf, 2023/09/15
- [PULL 24/28] block: remove AIOCBInfo->get_aio_context(), Kevin Wolf, 2023/09/15
- [PULL 21/28] block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 20/28] block: Mark bdrv_unref_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 28/28] block-coroutine-wrapper: use qemu_get_current_aio_context(), Kevin Wolf, 2023/09/15
- Re: [PULL 00/28] Block layer patches, Stefan Hajnoczi, 2023/09/18