]> git.proxmox.com Git - mirror_qemu.git/commit
block/io: refactor coroutine wrappers
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 24 Sep 2020 18:54:09 +0000 (21:54 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 5 Oct 2020 08:35:52 +0000 (09:35 +0100)
commitf9e694cb32403c7ebe8f8cc6949da47896afd561
tree1508148b617ea85cb8162143141b8d2a21fa6b5f
parent5416645fcf82a6cf520a83c82b577137058aaf32
block/io: refactor coroutine wrappers

Most of our coroutine wrappers already follow this convention:

We have 'coroutine_fn bdrv_co_<something>(<normal argument list>)' as
the core function, and a wrapper 'bdrv_<something>(<same argument
list>)' which does parameter packing and calls bdrv_run_co().

The only outsiders are the bdrv_prwv_co and
bdrv_common_block_status_above wrappers. Let's refactor them to behave
as the others, it simplifies further conversion of coroutine wrappers.

This patch adds an indirection layer, but it will be compensated by
a further commit, which will drop bdrv_co_prwv together with the
is_write logic, to keep the read and write paths separate.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200924185414.28642-3-vsementsov@virtuozzo.com>
block/io.c