]> git.proxmox.com Git - mirror_qemu.git/commit - scripts/block-coroutine-wrapper.py
block-coroutine-wrapper.py: support functions without bs arg
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 28 Nov 2022 14:23:34 +0000 (09:23 -0500)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:07:43 +0000 (16:07 +0100)
commit0582fb8293ad4a5d67810fb362789eba6e0ae75e
tree5098bc3b7904d731afb18c3f84612199b548180a
parent76a2f554c1e7b8acb332f765034fdf0ab3525202
block-coroutine-wrapper.py: support functions without bs arg

Right now, we take the first parameter of the function to get the
BlockDriverState to pass to bdrv_poll_co(), that internally calls
functions that figure in which aiocontext the coroutine should run.

However, it is useless to pass a bs just to get its own AioContext,
so instead pass it directly, and default to the main loop if no
BlockDriverState is passed as parameter.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20221128142337.657646-12-eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-gen.h
scripts/block-coroutine-wrapper.py