[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic retu
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic return types |
Date: |
Fri, 25 Nov 2022 23:52:54 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote:
Extend the regex to cover also return type, pointers included.
This implies that the value returned by the function cannot be
a simple "int" anymore, but the custom return type.
Therefore remove poll_state->ret and instead use a per-function
custom "ret" field.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
block/block-gen.h | 5 +----
scripts/block-coroutine-wrapper.py | 19 +++++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/block/block-gen.h b/block/block-gen.h
index 08d977f493..89b7daaa1f 100644
--- a/block/block-gen.h
+++ b/block/block-gen.h
[..]
# Match wrappers declared with a co_wrapper mark
-func_decl_re = re.compile(r'^int\s*co_wrapper'
+func_decl_re = re.compile(r'^(?P<return_type>[a-zA-Z][a-zA-Z0-9_]* [*]?)'
hmm interesting. I'd just write \* to mean '*' symbol. Probably it's a tiny bit
faster (and tiny bit shorter:)
--
Best regards,
Vladimir
- Re: [PATCH v6 11/14] block-coroutine-wrapper.py: default to main loop aiocontext if function does not have a BlockDriverState parameter, (continued)
- [PATCH v6 01/14] block-io: introduce coroutine_fn duplicates for bdrv_common_block_status_above callers, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 02/14] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 07/14] block: distinguish between bdrv_create running in coroutine and not, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 13/14] block: convert bdrv_create to co_wrapper, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic return types, Emanuele Giuseppe Esposito, 2022/11/25
- Re: [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic return types,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v6 09/14] block: rename generated_co_wrapper in co_wrapper_mixed, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 08/14] block: bdrv_create_file is a coroutine_fn, Emanuele Giuseppe Esposito, 2022/11/25
- [PATCH v6 14/14] block/dirty-bitmap: convert coroutine-only functions to co_wrapper, Emanuele Giuseppe Esposito, 2022/11/25