test-bdrv-drain: Don't modify the graph in coroutines
commit57f3d07b18a46cff4bc9dbb0a36173ef5b7420a3
authorKevin Wolf <kwolf@redhat.com>
Thu, 4 May 2023 11:57:35 +0000 (4 13:57 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 May 2023 12:16:53 +0000 (10 14:16 +0200)
tree77d7187da916f874b78bcaa97d13cbcb205cc905
parente113362e4cdfdcfe1d497e569527f70a0021333a
test-bdrv-drain: Don't modify the graph in coroutines

test-bdrv-drain contains a few test cases that are run both in coroutine
and non-coroutine context. Running the entire code including the setup
and shutdown in coroutines is incorrect because graph modifications can
generally not happen in coroutines.

Change the test so that creating and destroying the test nodes and
BlockBackends always happens outside of coroutine context.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20230504115750.54437-6-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/unit/test-bdrv-drain.c