From nobody Wed Nov 27 13:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1699382998; cv=none; d=zohomail.com; s=zohoarc; b=i8LFtlyCtK11lAgTrzBjA615lO3dBvbpD0G2kh2TpPcZ/z+HtT3A09v+UOOnYQ3F8Q9F9d1adY0KGCkEec6cSQ069zu1vA+jvGfBfTLpmbe0BvODdbAdHHhzHBA6oJedTrHnxau9fRHkMv319yj5T5kCzl+qYXSjp1Pze5a222M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699382998; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+zE+HS+uIwx6yB7BDyqVm7l1cutd3G7/ZUNns4aax3w=; b=aiYIw5tm+SAal0eOBVmcvQ+Oh5DuhIOlVG1hXTkwgozx41RoiMYX/+TaySYrLcJaUbTfQnhd2jO/Mv89d9bw7snJAkkEZPGt8eLZab7f2j3PN8peQHCYbn4Kv6UqREbbEQPL+J7ZH0tKaq4SCKtLny2wbwna8lx1hnogM5LUa48= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699382998692654.0454451252193; Tue, 7 Nov 2023 10:49:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0R7J-0000oZ-1m; Tue, 07 Nov 2023 13:48:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0R7H-0000iK-AI for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:47:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0R7E-0001gw-Sq for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:47:59 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-HIz2Iz5ANXCbHMVNjt41XA-1; Tue, 07 Nov 2023 13:46:31 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24D67811E7E for ; Tue, 7 Nov 2023 18:46:22 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EFB6C1596F; Tue, 7 Nov 2023 18:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699382875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+zE+HS+uIwx6yB7BDyqVm7l1cutd3G7/ZUNns4aax3w=; b=bHvA6D6AqBvchKs4QxwEkxZCx5/XTpFti6J2DAKFwHl89BAaw1aSOlwlLVmhKVpRK+jUEE q9EDuq4zdxJbohseU+ib90aUU++ECVsREKUSBfxz2BRNSUnlFJWKOqmdEvx1ESCzADAwPf qbbwcKQmXbVigeKQ00e8Mlbid4YdxpU= X-MC-Unique: HIz2Iz5ANXCbHMVNjt41XA-1 From: Kevin Wolf To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Subject: [PULL 19/25] block: Introduce bdrv_co_change_backing_file() Date: Tue, 7 Nov 2023 19:45:59 +0100 Message-ID: <20231107184605.236540-20-kwolf@redhat.com> In-Reply-To: <20231107184605.236540-1-kwolf@redhat.com> References: <20231107184605.236540-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1699382999790100001 Content-Type: text/plain; charset="utf-8" bdrv_change_backing_file() is called both inside and outside coroutine context. This makes it difficult for it to take the graph lock internally. It also means that driver implementations need to be able to run outside of coroutines, too. Switch it to the usual model with a coroutine based implementation and a co_wrapper instead. The new function is marked GRAPH_RDLOCK. As the co_wrapper now runs the function in the AioContext of the node (as it should always have done), this is not GLOBAL_STATE_CODE() any more. Signed-off-by: Kevin Wolf Message-ID: <20231027155333.420094-20-kwolf@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block-global-state.h | 3 +- include/block/block-io.h | 8 ++ include/block/block_int-common.h | 5 +- block.c | 11 +-- block/qcow2.c | 128 +++++++++++++++-------------- block/qed.c | 64 +++++++-------- tests/unit/test-bdrv-drain.c | 8 +- 7 files changed, 120 insertions(+), 107 deletions(-) diff --git a/include/block/block-global-state.h b/include/block/block-globa= l-state.h index 9e0ccc1c32..6b21fbc73f 100644 --- a/include/block/block-global-state.h +++ b/include/block/block-global-state.h @@ -142,8 +142,7 @@ bdrv_refresh_limits(BlockDriverState *bs, Transaction *= tran, Error **errp); =20 int bdrv_commit(BlockDriverState *bs); int GRAPH_RDLOCK bdrv_make_empty(BdrvChild *c, Error **errp); -int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_fil= e, - const char *backing_fmt, bool warn); + void bdrv_register(BlockDriver *bdrv); int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base, const char *backing_file_str); diff --git a/include/block/block-io.h b/include/block/block-io.h index 58c4cf50a0..f8729ccc55 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -210,6 +210,14 @@ void bdrv_round_to_subclusters(BlockDriverState *bs, void bdrv_get_backing_filename(BlockDriverState *bs, char *filename, int filename_size); =20 +int coroutine_fn GRAPH_RDLOCK +bdrv_co_change_backing_file(BlockDriverState *bs, const char *backing_file, + const char *backing_fmt, bool warn); + +int co_wrapper_bdrv_rdlock +bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file, + const char *backing_fmt, bool warn); + int bdrv_save_vmstate(BlockDriverState *bs, const uint8_t *buf, int64_t pos, int size); =20 diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index ed6066929a..59f6d7f195 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -331,8 +331,9 @@ struct BlockDriver { const char *name, Error **errp); =20 - int (*bdrv_change_backing_file)(BlockDriverState *bs, - const char *backing_file, const char *backing_fmt); + int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_change_backing_file)( + BlockDriverState *bs, const char *backing_file, + const char *backing_fmt); =20 /* TODO Better pass a option string/QDict/QemuOpts to add any rule? */ int (*bdrv_debug_breakpoint)(BlockDriverState *bs, const char *event, diff --git a/block.c b/block.c index ed0afdffbd..4910b95d7d 100644 --- a/block.c +++ b/block.c @@ -5764,13 +5764,14 @@ int coroutine_fn bdrv_co_check(BlockDriverState *bs, * image file header * -ENOTSUP - format driver doesn't support changing the backing file */ -int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_fil= e, - const char *backing_fmt, bool require) +int coroutine_fn +bdrv_co_change_backing_file(BlockDriverState *bs, const char *backing_file, + const char *backing_fmt, bool require) { BlockDriver *drv =3D bs->drv; int ret; =20 - GLOBAL_STATE_CODE(); + IO_CODE(); =20 if (!drv) { return -ENOMEDIUM; @@ -5785,8 +5786,8 @@ int bdrv_change_backing_file(BlockDriverState *bs, co= nst char *backing_file, return -EINVAL; } =20 - if (drv->bdrv_change_backing_file !=3D NULL) { - ret =3D drv->bdrv_change_backing_file(bs, backing_file, backing_fm= t); + if (drv->bdrv_co_change_backing_file !=3D NULL) { + ret =3D drv->bdrv_co_change_backing_file(bs, backing_file, backing= _fmt); } else { ret =3D -ENOTSUP; } diff --git a/block/qcow2.c b/block/qcow2.c index a1443a31aa..875e613ea9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3155,8 +3155,9 @@ fail: return ret; } =20 -static int qcow2_change_backing_file(BlockDriverState *bs, - const char *backing_file, const char *backing_fmt) +static int coroutine_fn GRAPH_RDLOCK +qcow2_co_change_backing_file(BlockDriverState *bs, const char *backing_fil= e, + const char *backing_fmt) { BDRVQcow2State *s =3D bs->opaque; =20 @@ -3816,8 +3817,11 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) backing_format =3D BlockdevDriver_str(qcow2_opts->backing_fmt); } =20 - ret =3D bdrv_change_backing_file(blk_bs(blk), qcow2_opts->backing_= file, - backing_format, false); + bdrv_graph_co_rdlock(); + ret =3D bdrv_co_change_backing_file(blk_bs(blk), qcow2_opts->backi= ng_file, + backing_format, false); + bdrv_graph_co_rdunlock(); + if (ret < 0) { error_setg_errno(errp, -ret, "Could not assign backing file '%= s' " "with format '%s'", qcow2_opts->backing_file, @@ -6115,64 +6119,64 @@ static const char *const qcow2_strong_runtime_opts[= ] =3D { }; =20 BlockDriver bdrv_qcow2 =3D { - .format_name =3D "qcow2", - .instance_size =3D sizeof(BDRVQcow2State), - .bdrv_probe =3D qcow2_probe, - .bdrv_open =3D qcow2_open, - .bdrv_close =3D qcow2_close, - .bdrv_reopen_prepare =3D qcow2_reopen_prepare, - .bdrv_reopen_commit =3D qcow2_reopen_commit, - .bdrv_reopen_commit_post =3D qcow2_reopen_commit_post, - .bdrv_reopen_abort =3D qcow2_reopen_abort, - .bdrv_join_options =3D qcow2_join_options, - .bdrv_child_perm =3D bdrv_default_perms, - .bdrv_co_create_opts =3D qcow2_co_create_opts, - .bdrv_co_create =3D qcow2_co_create, - .bdrv_has_zero_init =3D qcow2_has_zero_init, - .bdrv_co_block_status =3D qcow2_co_block_status, - - .bdrv_co_preadv_part =3D qcow2_co_preadv_part, - .bdrv_co_pwritev_part =3D qcow2_co_pwritev_part, - .bdrv_co_flush_to_os =3D qcow2_co_flush_to_os, - - .bdrv_co_pwrite_zeroes =3D qcow2_co_pwrite_zeroes, - .bdrv_co_pdiscard =3D qcow2_co_pdiscard, - .bdrv_co_copy_range_from =3D qcow2_co_copy_range_from, - .bdrv_co_copy_range_to =3D qcow2_co_copy_range_to, - .bdrv_co_truncate =3D qcow2_co_truncate, - .bdrv_co_pwritev_compressed_part =3D qcow2_co_pwritev_compressed_part, - .bdrv_make_empty =3D qcow2_make_empty, - - .bdrv_snapshot_create =3D qcow2_snapshot_create, - .bdrv_snapshot_goto =3D qcow2_snapshot_goto, - .bdrv_snapshot_delete =3D qcow2_snapshot_delete, - .bdrv_snapshot_list =3D qcow2_snapshot_list, - .bdrv_snapshot_load_tmp =3D qcow2_snapshot_load_tmp, - .bdrv_measure =3D qcow2_measure, - .bdrv_co_get_info =3D qcow2_co_get_info, - .bdrv_get_specific_info =3D qcow2_get_specific_info, - - .bdrv_co_save_vmstate =3D qcow2_co_save_vmstate, - .bdrv_co_load_vmstate =3D qcow2_co_load_vmstate, - - .is_format =3D true, - .supports_backing =3D true, - .bdrv_change_backing_file =3D qcow2_change_backing_file, - - .bdrv_refresh_limits =3D qcow2_refresh_limits, - .bdrv_co_invalidate_cache =3D qcow2_co_invalidate_cache, - .bdrv_inactivate =3D qcow2_inactivate, - - .create_opts =3D &qcow2_create_opts, - .amend_opts =3D &qcow2_amend_opts, - .strong_runtime_opts =3D qcow2_strong_runtime_opts, - .mutable_opts =3D mutable_opts, - .bdrv_co_check =3D qcow2_co_check, - .bdrv_amend_options =3D qcow2_amend_options, - .bdrv_co_amend =3D qcow2_co_amend, - - .bdrv_detach_aio_context =3D qcow2_detach_aio_context, - .bdrv_attach_aio_context =3D qcow2_attach_aio_context, + .format_name =3D "qcow2", + .instance_size =3D sizeof(BDRVQcow2State), + .bdrv_probe =3D qcow2_probe, + .bdrv_open =3D qcow2_open, + .bdrv_close =3D qcow2_close, + .bdrv_reopen_prepare =3D qcow2_reopen_prepare, + .bdrv_reopen_commit =3D qcow2_reopen_commit, + .bdrv_reopen_commit_post =3D qcow2_reopen_commit_post, + .bdrv_reopen_abort =3D qcow2_reopen_abort, + .bdrv_join_options =3D qcow2_join_options, + .bdrv_child_perm =3D bdrv_default_perms, + .bdrv_co_create_opts =3D qcow2_co_create_opts, + .bdrv_co_create =3D qcow2_co_create, + .bdrv_has_zero_init =3D qcow2_has_zero_init, + .bdrv_co_block_status =3D qcow2_co_block_status, + + .bdrv_co_preadv_part =3D qcow2_co_preadv_part, + .bdrv_co_pwritev_part =3D qcow2_co_pwritev_part, + .bdrv_co_flush_to_os =3D qcow2_co_flush_to_os, + + .bdrv_co_pwrite_zeroes =3D qcow2_co_pwrite_zeroes, + .bdrv_co_pdiscard =3D qcow2_co_pdiscard, + .bdrv_co_copy_range_from =3D qcow2_co_copy_range_from, + .bdrv_co_copy_range_to =3D qcow2_co_copy_range_to, + .bdrv_co_truncate =3D qcow2_co_truncate, + .bdrv_co_pwritev_compressed_part =3D qcow2_co_pwritev_compressed_pa= rt, + .bdrv_make_empty =3D qcow2_make_empty, + + .bdrv_snapshot_create =3D qcow2_snapshot_create, + .bdrv_snapshot_goto =3D qcow2_snapshot_goto, + .bdrv_snapshot_delete =3D qcow2_snapshot_delete, + .bdrv_snapshot_list =3D qcow2_snapshot_list, + .bdrv_snapshot_load_tmp =3D qcow2_snapshot_load_tmp, + .bdrv_measure =3D qcow2_measure, + .bdrv_co_get_info =3D qcow2_co_get_info, + .bdrv_get_specific_info =3D qcow2_get_specific_info, + + .bdrv_co_save_vmstate =3D qcow2_co_save_vmstate, + .bdrv_co_load_vmstate =3D qcow2_co_load_vmstate, + + .is_format =3D true, + .supports_backing =3D true, + .bdrv_co_change_backing_file =3D qcow2_co_change_backing_file, + + .bdrv_refresh_limits =3D qcow2_refresh_limits, + .bdrv_co_invalidate_cache =3D qcow2_co_invalidate_cache, + .bdrv_inactivate =3D qcow2_inactivate, + + .create_opts =3D &qcow2_create_opts, + .amend_opts =3D &qcow2_amend_opts, + .strong_runtime_opts =3D qcow2_strong_runtime_opts, + .mutable_opts =3D mutable_opts, + .bdrv_co_check =3D qcow2_co_check, + .bdrv_amend_options =3D qcow2_amend_options, + .bdrv_co_amend =3D qcow2_co_amend, + + .bdrv_detach_aio_context =3D qcow2_detach_aio_context, + .bdrv_attach_aio_context =3D qcow2_attach_aio_context, =20 .bdrv_supports_persistent_dirty_bitmap =3D qcow2_supports_persistent_dirty_bitmap, diff --git a/block/qed.c b/block/qed.c index 686ad711f7..996aa384fe 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1498,9 +1498,9 @@ bdrv_qed_co_get_info(BlockDriverState *bs, BlockDrive= rInfo *bdi) return 0; } =20 -static int bdrv_qed_change_backing_file(BlockDriverState *bs, - const char *backing_file, - const char *backing_fmt) +static int coroutine_fn GRAPH_RDLOCK +bdrv_qed_co_change_backing_file(BlockDriverState *bs, const char *backing_= file, + const char *backing_fmt) { BDRVQEDState *s =3D bs->opaque; QEDHeader new_header, le_header; @@ -1562,7 +1562,7 @@ static int bdrv_qed_change_backing_file(BlockDriverSt= ate *bs, } =20 /* Write new header */ - ret =3D bdrv_pwrite_sync(bs->file, 0, buffer_len, buffer, 0); + ret =3D bdrv_co_pwrite_sync(bs->file, 0, buffer_len, buffer, 0); g_free(buffer); if (ret =3D=3D 0) { memcpy(&s->header, &new_header, sizeof(new_header)); @@ -1636,34 +1636,34 @@ static QemuOptsList qed_create_opts =3D { }; =20 static BlockDriver bdrv_qed =3D { - .format_name =3D "qed", - .instance_size =3D sizeof(BDRVQEDState), - .create_opts =3D &qed_create_opts, - .is_format =3D true, - .supports_backing =3D true, - - .bdrv_probe =3D bdrv_qed_probe, - .bdrv_open =3D bdrv_qed_open, - .bdrv_close =3D bdrv_qed_close, - .bdrv_reopen_prepare =3D bdrv_qed_reopen_prepare, - .bdrv_child_perm =3D bdrv_default_perms, - .bdrv_co_create =3D bdrv_qed_co_create, - .bdrv_co_create_opts =3D bdrv_qed_co_create_opts, - .bdrv_has_zero_init =3D bdrv_has_zero_init_1, - .bdrv_co_block_status =3D bdrv_qed_co_block_status, - .bdrv_co_readv =3D bdrv_qed_co_readv, - .bdrv_co_writev =3D bdrv_qed_co_writev, - .bdrv_co_pwrite_zeroes =3D bdrv_qed_co_pwrite_zeroes, - .bdrv_co_truncate =3D bdrv_qed_co_truncate, - .bdrv_co_getlength =3D bdrv_qed_co_getlength, - .bdrv_co_get_info =3D bdrv_qed_co_get_info, - .bdrv_refresh_limits =3D bdrv_qed_refresh_limits, - .bdrv_change_backing_file =3D bdrv_qed_change_backing_file, - .bdrv_co_invalidate_cache =3D bdrv_qed_co_invalidate_cache, - .bdrv_co_check =3D bdrv_qed_co_check, - .bdrv_detach_aio_context =3D bdrv_qed_detach_aio_context, - .bdrv_attach_aio_context =3D bdrv_qed_attach_aio_context, - .bdrv_drain_begin =3D bdrv_qed_drain_begin, + .format_name =3D "qed", + .instance_size =3D sizeof(BDRVQEDState), + .create_opts =3D &qed_create_opts, + .is_format =3D true, + .supports_backing =3D true, + + .bdrv_probe =3D bdrv_qed_probe, + .bdrv_open =3D bdrv_qed_open, + .bdrv_close =3D bdrv_qed_close, + .bdrv_reopen_prepare =3D bdrv_qed_reopen_prepare, + .bdrv_child_perm =3D bdrv_default_perms, + .bdrv_co_create =3D bdrv_qed_co_create, + .bdrv_co_create_opts =3D bdrv_qed_co_create_opts, + .bdrv_has_zero_init =3D bdrv_has_zero_init_1, + .bdrv_co_block_status =3D bdrv_qed_co_block_status, + .bdrv_co_readv =3D bdrv_qed_co_readv, + .bdrv_co_writev =3D bdrv_qed_co_writev, + .bdrv_co_pwrite_zeroes =3D bdrv_qed_co_pwrite_zeroes, + .bdrv_co_truncate =3D bdrv_qed_co_truncate, + .bdrv_co_getlength =3D bdrv_qed_co_getlength, + .bdrv_co_get_info =3D bdrv_qed_co_get_info, + .bdrv_refresh_limits =3D bdrv_qed_refresh_limits, + .bdrv_co_change_backing_file =3D bdrv_qed_co_change_backing_file, + .bdrv_co_invalidate_cache =3D bdrv_qed_co_invalidate_cache, + .bdrv_co_check =3D bdrv_qed_co_check, + .bdrv_detach_aio_context =3D bdrv_qed_detach_aio_context, + .bdrv_attach_aio_context =3D bdrv_qed_attach_aio_context, + .bdrv_drain_begin =3D bdrv_qed_drain_begin, }; =20 static void bdrv_qed_init(void) diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index ba4e42b197..8d05538bf6 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -96,9 +96,9 @@ static int coroutine_fn bdrv_test_co_preadv(BlockDriverSt= ate *bs, return 0; } =20 -static int bdrv_test_change_backing_file(BlockDriverState *bs, - const char *backing_file, - const char *backing_fmt) +static int bdrv_test_co_change_backing_file(BlockDriverState *bs, + const char *backing_file, + const char *backing_fmt) { return 0; } @@ -116,7 +116,7 @@ static BlockDriver bdrv_test =3D { =20 .bdrv_child_perm =3D bdrv_default_perms, =20 - .bdrv_change_backing_file =3D bdrv_test_change_backing_file, + .bdrv_co_change_backing_file =3D bdrv_test_co_change_backing_file, }; =20 static void aio_ret_cb(void *opaque, int ret) --=20 2.41.0