OSDN Git Service

block: distinguish between bdrv_create running in coroutine and not
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 28 Nov 2022 14:23:30 +0000 (09:23 -0500)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:07:43 +0000 (16:07 +0100)
commit84bdf21f97e670d61615d44a95d2f33b41f849b1
tree708d075f8da80e89c9bbec43b950922c60ca0fff
parenta212e675cde67fb783b7f8e5b31dd02e9c880f58
block: distinguish between bdrv_create running in coroutine and not

Call two different functions depending on whether bdrv_create
is in coroutine or not, following the same pattern as
generated_co_wrapper functions.

This allows to also call the coroutine function directly,
without using CreateCo or relying in bdrv_create().

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>
Message-Id: <20221128142337.657646-8-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c