OSDN Git Service

test-bdrv-drain: Call bdrv_co_unref() in coroutine context
authorKevin Wolf <kwolf@redhat.com>
Wed, 10 May 2023 20:35:59 +0000 (22:35 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 19 May 2023 17:12:12 +0000 (19:12 +0200)
bdrv_unref() is a no_coroutine_fn, so calling it from coroutine context
is invalid. Use bdrv_co_unref() instead.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230510203601.418015-7-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/unit/test-bdrv-drain.c

index ae4299c..08bb0f9 100644 (file)
@@ -1019,7 +1019,7 @@ static void coroutine_fn test_co_delete_by_drain(void *opaque)
     g_assert_cmpint(bs->refcnt, ==, 1);
 
     if (!dbdd->detach_instead_of_delete) {
-        blk_unref(blk);
+        blk_co_unref(blk);
     } else {
         BdrvChild *c, *next_c;
         QLIST_FOREACH_SAFE(c, &bs->children, next, next_c) {