[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 27/32] block-coroutine-wrapper: allow non bdrv_ prefix
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 27/32] block-coroutine-wrapper: allow non bdrv_ prefix |
Date: |
Thu, 10 Jun 2021 13:07:57 +0300 |
We are going to reuse the script to generate a nbd_ function in
further commit. Prepare the script now.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@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 0461fd1c45..85dbeb9ecf 100644
--- a/scripts/block-coroutine-wrapper.py
+++ b/scripts/block-coroutine-wrapper.py
@@ -98,12 +98,13 @@ def snake_to_camel(func_name: str) -> str:
def gen_wrapper(func: FuncDecl) -> str:
- assert func.name.startswith('bdrv_')
- assert not func.name.startswith('bdrv_co_')
+ assert not '_co_' in func.name
assert func.return_type == 'int'
assert func.args[0].type in ['BlockDriverState *', 'BdrvChild *']
- name = 'bdrv_co_' + func.name[5:]
+ subsystem, subname = func.name.split('_', 1)
+
+ name = f'{subsystem}_co_{subname}'
bs = 'bs' if func.args[0].type == 'BlockDriverState *' else 'child->bs'
struct_name = snake_to_camel(name)
--
2.29.2
- [PATCH v4 11/32] block/nbd: drop thr->state, (continued)
- [PATCH v4 11/32] block/nbd: drop thr->state, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 05/32] qemu-sockets: introduce socket_address_parse_named_fd(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 13/32] block/nbd: make nbd_co_establish_connection_cancel() bs-independent, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 15/32] block/nbd: introduce nbd_client_connection_new(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 21/32] nbd/client-connection: shutdown connection on release, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 25/32] block/nbd: drop BDRVNBDState::sioc, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 27/32] block-coroutine-wrapper: allow non bdrv_ prefix,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 16/32] block/nbd: introduce nbd_client_connection_release(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 20/32] nbd/client-connection: implement connection retry, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 28/32] block/nbd: split nbd_co_do_establish_connection out of nbd_reconnect_attempt, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 23/32] block/nbd: use negotiation of NBDClientConnection, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 22/32] block/nbd: split nbd_handle_updated_info out of nbd_client_handshake(), Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 14/32] block/nbd: rename NBDConnectThread to NBDClientConnection, Vladimir Sementsov-Ogievskiy, 2021/06/10
- [PATCH v4 26/32] nbd/client-connection: return only one io channel, Vladimir Sementsov-Ogievskiy, 2021/06/10