qemu-block
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]