All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, crosa@redhat.com, ehabkost@redhat.com,
	mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com,
	philmd@redhat.com
Subject: [PATCH 01/11] block-coroutine-wrapper: allow non bdrv_ prefix
Date: Sat, 24 Apr 2021 00:40:23 +0300	[thread overview]
Message-ID: <20210423214033.474034-2-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20210423214033.474034-1-vsementsov@virtuozzo.com>

We are going to reuse the script to generate a qcow2_ function in
further commit. Prepare the script now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.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



  reply	other threads:[~2021-04-23 21:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 21:40 [PATCH 00/11] qemu-io-cmds: move to coroutine Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` Vladimir Sementsov-Ogievskiy [this message]
2021-04-23 21:40 ` [PATCH 02/11] block-coroutine-wrapper: support BlockBackend first argument Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 03/11] block/block-gen.h: bind monitor Vladimir Sementsov-Ogievskiy
2021-04-24  5:23   ` Markus Armbruster
2021-04-26  9:12     ` Vladimir Sementsov-Ogievskiy
2021-04-26 12:23       ` Markus Armbruster
2021-04-23 21:40 ` [PATCH 04/11] block: introduce bdrv_debug_wait_break Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 05/11] qemu-io-cmds: move qemu-io commands to coroutine Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 06/11] block: drop unused bdrv_debug_is_suspended() Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 07/11] block-backend: add _co_ versions of blk_save_vmstate / blk_load_vmstate Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 08/11] qemu-io-cmds: refactor read_f(): drop extra helpers and variables Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 09/11] qemu-io-cmds: refactor write_f(): " Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 10/11] qemu-io-cmds: drop do_co_readv() and do_co_writev() helpers Vladimir Sementsov-Ogievskiy
2021-04-23 21:40 ` [PATCH 11/11] block-backend: drop unused blk_save_vmstate() and blk_load_vmstate() Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210423214033.474034-2-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.