From nobody Wed Apr 16 07:45:39 2025 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=1682429032; cv=none; d=zohomail.com; s=zohoarc; b=D3YsFvpTX9vkT6/KY7sJBozsztwNY+peY8vI8s1vkhawebqtfe3Dp3YMgui5PmKDGjZpb1RRW4w4VSY4FXhgiluEmRhE0zxI0WotTGR7NXnNm9bXSVb+CvXBsnfn/qITaYHBz03zGqjHbgwZxxi4wP1l+jIqv54GGcyLitJze7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682429032; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G5LaIixywHQ5ouRaZs16frq4M+d3Q1atIcWQp1CnFh0=; b=LdaWP4GHNsf/1yLMSB+js1ne8tbpnlDpjbD4o5V2b5Capr7oz9bdAgRZa6y9TJDOe7d48dqPlYcnvKLxj8qAuB83AU6hmQCC956dQoUibguJOHzEwGjeo2VLDrqUFpAXyK3bbYR8LwgLRuHES2KtJkt4jVLFM93wu8iqrwnDpVQ= 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 1682429032541362.867914716982; Tue, 25 Apr 2023 06:23:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prIVi-0007La-Og; Tue, 25 Apr 2023 09:15:10 -0400 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 1prIVK-0006eJ-4F for qemu-devel@nongnu.org; Tue, 25 Apr 2023 09:14:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prIVG-0006cX-10 for qemu-devel@nongnu.org; Tue, 25 Apr 2023 09:14:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-X4hvrHuSP76-auECGXGEaw-1; Tue, 25 Apr 2023 09:14:26 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 42AE9185A79C; Tue, 25 Apr 2023 13:14:26 +0000 (UTC) Received: from merkur.redhat.com (unknown [10.39.193.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DD8C40C2064; Tue, 25 Apr 2023 13:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682428469; 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=G5LaIixywHQ5ouRaZs16frq4M+d3Q1atIcWQp1CnFh0=; b=bg9CmmN4PS9bN5e3qhQzFIKCuraFqyGbvCCaSYymbKBvxU1EH+nJ8KH8RQ33xc7ShU46Cp IZwdhbj/THmCm5B2fheyro3C0sw+ityChIQQAW5iOyoNiKlpH2wd062xOW8BUl5yIzFUyh Ki/g1ErAlmDSS/7Pio39aprT7kCDdzE= X-MC-Unique: X4hvrHuSP76-auECGXGEaw-1 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org Subject: [PULL 23/25] qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK Date: Tue, 25 Apr 2023 15:13:57 +0200 Message-Id: <20230425131359.259007-24-kwolf@redhat.com> In-Reply-To: <20230425131359.259007-1-kwolf@redhat.com> References: <20230425131359.259007-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-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: 1682429033039100001 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Functions that can do I/O (including calling bdrv_is_allocated and bdrv_block_status functions) are prime candidates for being coroutine_fns. Make the change for those that are themselves called only from coroutine_fns. Also annotate that they are called with the graph rdlock taken, thus allowing them to call bdrv_co_*() functions for I/O. Signed-off-by: Paolo Bonzini Message-Id: <20230309084456.304669-9-pbonzini@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/qcow2.h | 15 ++++++++------- block/qcow2-bitmap.c | 2 +- block/qcow2-cluster.c | 21 +++++++++++++-------- block/qcow2-refcount.c | 8 ++++---- block/qcow2-snapshot.c | 25 +++++++++++++------------ block/qcow2.c | 27 ++++++++++++++------------- 6 files changed, 53 insertions(+), 45 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index c59e33c01c..c75decc38a 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -862,9 +862,9 @@ int64_t qcow2_refcount_area(BlockDriverState *bs, uint6= 4_t offset, uint64_t new_refblock_offset); =20 int64_t qcow2_alloc_clusters(BlockDriverState *bs, uint64_t size); -int64_t qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset, - int64_t nb_clusters); -int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size); +int64_t coroutine_fn qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_= t offset, + int64_t nb_clusters); +int64_t coroutine_fn qcow2_alloc_bytes(BlockDriverState *bs, int size); void qcow2_free_clusters(BlockDriverState *bs, int64_t offset, int64_t size, enum qcow2_discard_type type); @@ -894,7 +894,7 @@ int qcow2_change_refcount_order(BlockDriverState *bs, i= nt refcount_order, BlockDriverAmendStatusCB *status_cb, void *cb_opaque, Error **errp); int coroutine_fn GRAPH_RDLOCK qcow2_shrink_reftable(BlockDriverState *bs); -int64_t qcow2_get_last_cluster(BlockDriverState *bs, int64_t size); +int64_t coroutine_fn qcow2_get_last_cluster(BlockDriverState *bs, int64_t = size); int coroutine_fn qcow2_detect_metadata_preallocation(BlockDriverState *bs); =20 /* qcow2-cluster.c functions */ @@ -924,7 +924,7 @@ void qcow2_parse_compressed_l2_entry(BlockDriverState *= bs, uint64_t l2_entry, int coroutine_fn GRAPH_RDLOCK qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m); =20 -void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m); +void coroutine_fn qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Me= ta *m); int qcow2_cluster_discard(BlockDriverState *bs, uint64_t offset, uint64_t bytes, enum qcow2_discard_type type, bool full_discard); @@ -951,7 +951,8 @@ int qcow2_snapshot_load_tmp(BlockDriverState *bs, Error **errp); =20 void qcow2_free_snapshots(BlockDriverState *bs); -int qcow2_read_snapshots(BlockDriverState *bs, Error **errp); +int coroutine_fn GRAPH_RDLOCK +qcow2_read_snapshots(BlockDriverState *bs, Error **errp); int qcow2_write_snapshots(BlockDriverState *bs); =20 int coroutine_fn GRAPH_RDLOCK @@ -994,7 +995,7 @@ bool coroutine_fn qcow2_load_dirty_bitmaps(BlockDriverS= tate *bs, bool qcow2_get_bitmap_info_list(BlockDriverState *bs, Qcow2BitmapInfoList **info_list, Error **e= rrp); int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp); -int qcow2_truncate_bitmaps_check(BlockDriverState *bs, Error **errp); +int coroutine_fn qcow2_truncate_bitmaps_check(BlockDriverState *bs, Error = **errp); bool qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, bool release_stored, Error **err= p); int qcow2_reopen_bitmaps_ro(BlockDriverState *bs, Error **errp); diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 5f456a2785..a952fd58d8 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -1221,7 +1221,7 @@ out: } =20 /* Checks to see if it's safe to resize bitmaps */ -int qcow2_truncate_bitmaps_check(BlockDriverState *bs, Error **errp) +int coroutine_fn qcow2_truncate_bitmaps_check(BlockDriverState *bs, Error = **errp) { BDRVQcow2State *s =3D bs->opaque; Qcow2BitmapList *bm_list; diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index a9e6622fe3..39cda7f907 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -1126,7 +1126,7 @@ err: * Frees the allocated clusters because the request failed and they won't * actually be linked. */ -void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m) +void coroutine_fn qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Me= ta *m) { BDRVQcow2State *s =3D bs->opaque; if (!has_data_file(bs) && !m->keep_old_clusters) { @@ -1156,9 +1156,11 @@ void qcow2_alloc_cluster_abort(BlockDriverState *bs,= QCowL2Meta *m) * * Returns 0 on success, -errno on failure. */ -static int calculate_l2_meta(BlockDriverState *bs, uint64_t host_cluster_o= ffset, - uint64_t guest_offset, unsigned bytes, - uint64_t *l2_slice, QCowL2Meta **m, bool keep= _old) +static int coroutine_fn calculate_l2_meta(BlockDriverState *bs, + uint64_t host_cluster_offset, + uint64_t guest_offset, unsigned = bytes, + uint64_t *l2_slice, QCowL2Meta *= *m, + bool keep_old) { BDRVQcow2State *s =3D bs->opaque; int sc_index, l2_index =3D offset_to_l2_slice_index(s, guest_offset); @@ -1599,8 +1601,10 @@ out: * function has been waiting for another request and the allocation must be * restarted, but the whole request should not be failed. */ -static int do_alloc_cluster_offset(BlockDriverState *bs, uint64_t guest_of= fset, - uint64_t *host_offset, uint64_t *nb_clu= sters) +static int coroutine_fn do_alloc_cluster_offset(BlockDriverState *bs, + uint64_t guest_offset, + uint64_t *host_offset, + uint64_t *nb_clusters) { BDRVQcow2State *s =3D bs->opaque; =20 @@ -2065,8 +2069,9 @@ static int zero_in_l2_slice(BlockDriverState *bs, uin= t64_t offset, return nb_clusters; } =20 -static int zero_l2_subclusters(BlockDriverState *bs, uint64_t offset, - unsigned nb_subclusters) +static int coroutine_fn +zero_l2_subclusters(BlockDriverState *bs, uint64_t offset, + unsigned nb_subclusters) { BDRVQcow2State *s =3D bs->opaque; uint64_t *l2_slice; diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index b092f89da9..b2a81ff707 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1030,8 +1030,8 @@ int64_t qcow2_alloc_clusters(BlockDriverState *bs, ui= nt64_t size) return offset; } =20 -int64_t qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset, - int64_t nb_clusters) +int64_t coroutine_fn qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_= t offset, + int64_t nb_clusters) { BDRVQcow2State *s =3D bs->opaque; uint64_t cluster_index, refcount; @@ -1069,7 +1069,7 @@ int64_t qcow2_alloc_clusters_at(BlockDriverState *bs,= uint64_t offset, =20 /* only used to allocate compressed sectors. We try to allocate contiguous sectors. size must be <=3D cluster_size */ -int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size) +int64_t coroutine_fn qcow2_alloc_bytes(BlockDriverState *bs, int size) { BDRVQcow2State *s =3D bs->opaque; int64_t offset; @@ -3685,7 +3685,7 @@ out: return ret; } =20 -int64_t qcow2_get_last_cluster(BlockDriverState *bs, int64_t size) +int64_t coroutine_fn qcow2_get_last_cluster(BlockDriverState *bs, int64_t = size) { BDRVQcow2State *s =3D bs->opaque; int64_t i; diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 62e8a0335d..92e47978bf 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -77,10 +77,11 @@ void qcow2_free_snapshots(BlockDriverState *bs) * qcow2_check_refcounts() does not do anything with snapshots' * extra data.) */ -static int qcow2_do_read_snapshots(BlockDriverState *bs, bool repair, - int *nb_clusters_reduced, - int *extra_data_dropped, - Error **errp) +static coroutine_fn GRAPH_RDLOCK +int qcow2_do_read_snapshots(BlockDriverState *bs, bool repair, + int *nb_clusters_reduced, + int *extra_data_dropped, + Error **errp) { BDRVQcow2State *s =3D bs->opaque; QCowSnapshotHeader h; @@ -108,7 +109,7 @@ static int qcow2_do_read_snapshots(BlockDriverState *bs= , bool repair, =20 /* Read statically sized part of the snapshot header */ offset =3D ROUND_UP(offset, 8); - ret =3D bdrv_pread(bs->file, offset, sizeof(h), &h, 0); + ret =3D bdrv_co_pread(bs->file, offset, sizeof(h), &h, 0); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to read snapshot table"); goto fail; @@ -146,8 +147,8 @@ static int qcow2_do_read_snapshots(BlockDriverState *bs= , bool repair, } =20 /* Read known extra data */ - ret =3D bdrv_pread(bs->file, offset, - MIN(sizeof(extra), sn->extra_data_size), &extra, = 0); + ret =3D bdrv_co_pread(bs->file, offset, + MIN(sizeof(extra), sn->extra_data_size), &extr= a, 0); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to read snapshot table"); goto fail; @@ -184,8 +185,8 @@ static int qcow2_do_read_snapshots(BlockDriverState *bs= , bool repair, /* Store unknown extra data */ unknown_extra_data_size =3D sn->extra_data_size - sizeof(extra= ); sn->unknown_extra_data =3D g_malloc(unknown_extra_data_size); - ret =3D bdrv_pread(bs->file, offset, unknown_extra_data_size, - sn->unknown_extra_data, 0); + ret =3D bdrv_co_pread(bs->file, offset, unknown_extra_data_siz= e, + sn->unknown_extra_data, 0); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to read snapshot table"); @@ -196,7 +197,7 @@ static int qcow2_do_read_snapshots(BlockDriverState *bs= , bool repair, =20 /* Read snapshot ID */ sn->id_str =3D g_malloc(id_str_size + 1); - ret =3D bdrv_pread(bs->file, offset, id_str_size, sn->id_str, 0); + ret =3D bdrv_co_pread(bs->file, offset, id_str_size, sn->id_str, 0= ); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to read snapshot table"); goto fail; @@ -206,7 +207,7 @@ static int qcow2_do_read_snapshots(BlockDriverState *bs= , bool repair, =20 /* Read snapshot name */ sn->name =3D g_malloc(name_size + 1); - ret =3D bdrv_pread(bs->file, offset, name_size, sn->name, 0); + ret =3D bdrv_co_pread(bs->file, offset, name_size, sn->name, 0); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to read snapshot table"); goto fail; @@ -261,7 +262,7 @@ fail: return ret; } =20 -int qcow2_read_snapshots(BlockDriverState *bs, Error **errp) +int coroutine_fn qcow2_read_snapshots(BlockDriverState *bs, Error **errp) { return qcow2_do_read_snapshots(bs, false, NULL, NULL, errp); } diff --git a/block/qcow2.c b/block/qcow2.c index 30fd53fa64..fe5def438e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -199,10 +199,10 @@ qcow2_extract_crypto_opts(QemuOpts *opts, const char = *fmt, Error **errp) * unknown magic is skipped (future extension this version knows nothing a= bout) * return 0 upon success, non-0 otherwise */ -static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offs= et, - uint64_t end_offset, void **p_feature_tab= le, - int flags, bool *need_update_header, - Error **errp) +static int coroutine_fn GRAPH_RDLOCK +qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset, + uint64_t end_offset, void **p_feature_table, + int flags, bool *need_update_header, Error **errp) { BDRVQcow2State *s =3D bs->opaque; QCowExtension ext; @@ -228,7 +228,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, printf("attempting to read extended header in offset %lu\n", offse= t); #endif =20 - ret =3D bdrv_pread(bs->file, offset, sizeof(ext), &ext, 0); + ret =3D bdrv_co_pread(bs->file, offset, sizeof(ext), &ext, 0); if (ret < 0) { error_setg_errno(errp, -ret, "qcow2_read_extension: ERROR: " "pread fail from offset %" PRIu64, offset); @@ -256,7 +256,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, sizeof(bs->backing_format)); return 2; } - ret =3D bdrv_pread(bs->file, offset, ext.len, bs->backing_form= at, 0); + ret =3D bdrv_co_pread(bs->file, offset, ext.len, bs->backing_f= ormat, 0); if (ret < 0) { error_setg_errno(errp, -ret, "ERROR: ext_backing_format: " "Could not read format name"); @@ -272,7 +272,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, case QCOW2_EXT_MAGIC_FEATURE_TABLE: if (p_feature_table !=3D NULL) { void *feature_table =3D g_malloc0(ext.len + 2 * sizeof(Qco= w2Feature)); - ret =3D bdrv_pread(bs->file, offset, ext.len, feature_tabl= e, 0); + ret =3D bdrv_co_pread(bs->file, offset, ext.len, feature_t= able, 0); if (ret < 0) { error_setg_errno(errp, -ret, "ERROR: ext_feature_table= : " "Could not read table"); @@ -298,7 +298,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, return -EINVAL; } =20 - ret =3D bdrv_pread(bs->file, offset, ext.len, &s->crypto_heade= r, 0); + ret =3D bdrv_co_pread(bs->file, offset, ext.len, &s->crypto_he= ader, 0); if (ret < 0) { error_setg_errno(errp, -ret, "Unable to read CRYPTO header extension"); @@ -354,7 +354,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, break; } =20 - ret =3D bdrv_pread(bs->file, offset, ext.len, &bitmaps_ext, 0); + ret =3D bdrv_co_pread(bs->file, offset, ext.len, &bitmaps_ext,= 0); if (ret < 0) { error_setg_errno(errp, -ret, "bitmaps_ext: " "Could not read ext header"); @@ -418,7 +418,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, case QCOW2_EXT_MAGIC_DATA_FILE: { s->image_data_file =3D g_malloc0(ext.len + 1); - ret =3D bdrv_pread(bs->file, offset, ext.len, s->image_data_fi= le, 0); + ret =3D bdrv_co_pread(bs->file, offset, ext.len, s->image_data= _file, 0); if (ret < 0) { error_setg_errno(errp, -ret, "ERROR: Could not read data file name"); @@ -442,7 +442,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, uext->len =3D ext.len; QLIST_INSERT_HEAD(&s->unknown_header_ext, uext, next); =20 - ret =3D bdrv_pread(bs->file, offset, uext->len, uext->data= , 0); + ret =3D bdrv_co_pread(bs->file, offset, uext->len, uext->d= ata, 0); if (ret < 0) { error_setg_errno(errp, -ret, "ERROR: unknown extension= : " "Could not read data"); @@ -1241,8 +1241,9 @@ static void qcow2_update_options_abort(BlockDriverSta= te *bs, qapi_free_QCryptoBlockOpenOptions(r->crypto_opts); } =20 -static int qcow2_update_options(BlockDriverState *bs, QDict *options, - int flags, Error **errp) +static int coroutine_fn +qcow2_update_options(BlockDriverState *bs, QDict *options, int flags, + Error **errp) { Qcow2ReopenState r =3D {}; int ret; --=20 2.40.0