From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351603; cv=none; d=zohomail.com; s=zohoarc; b=YxA8V9hKaO0R2aJghOYgEFluf/MNv3iiU4cxYH6LW27XjWzvZzAAna8vV0MkCwQSzvoIMD3W74gzFfqRQZS3ejG9LRf9B6U340Xi22eBlPXYA2d3ERV36cd/z3M9ZaB4n4y/h2ngSm5fZwkxC10OuYgiqZQJvluDEkGVXeYtinU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351603; h=Content-Type: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=Wui4DGcWr65hFfF1Xw5hpHWkyQT47TcYO6zNbQJNigk=; b=R9wZJOxv5rRbkAtS/KTXvTGktiVIBXs5AwqFMGrTN6migCaFMgXs0OA7pDIp+NRoYec5U8EXHSZefEEi+RMaeLCalvsvtMadWLy/IV1nCHSft/M82oFgFDT5Efr13JO5XRsoOIYkC2trKYFBsjVB3BmmOc/LWqX55wrd3XjCkck= 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+importer2=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 167835160369036.38369904731803; Thu, 9 Mar 2023 00:46:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBte-0000FG-5R; Thu, 09 Mar 2023 03:45:10 -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 1paBta-0000DH-MC for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:06 -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 1paBtY-0008TO-D4 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:06 -0500 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-272-5gDKl82rPMOX301kPvDp9g-1; Thu, 09 Mar 2023 03:45:01 -0500 Received: by mail-ed1-f69.google.com with SMTP id v11-20020a056402348b00b004ce34232666so1914568edc.3 for ; Thu, 09 Mar 2023 00:45:01 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id c6-20020a170906d18600b0090e0a4e1bacsm6819728ejz.159.2023.03.09.00.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wui4DGcWr65hFfF1Xw5hpHWkyQT47TcYO6zNbQJNigk=; b=h9d6/rAjHvsHiCLtfxPeTaD+wEmQ9G9X4ClJXnkENimuuBJh6ne+Cow286jKBfhbTr+fWW 7nXiSOGFLpTbf+IlV65QHyLb875AjkcStg4CSsnnIZ7nhQZwzvQoT/DD1zbm2866ffE7aM IESZ9REkbKAzKyf84OaUMbtTZpKBXoE= X-MC-Unique: 5gDKl82rPMOX301kPvDp9g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351500; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wui4DGcWr65hFfF1Xw5hpHWkyQT47TcYO6zNbQJNigk=; b=EIAEASYebYzxwifbBVuAmTBdqDDjLxnd9qQ6qTrXWSV2yGhz5SiaXbXvAVGCMf8T1r 9QZ0fscdpYxJE6fU8hEuwUmEFi3d3vZDDV7gXgrYkEJXV45iWBSter0PuGrbk7yEqbku uBM3W06BJp51yJAci+0+0/UWREpYs7923bxKQZzrxZBL1UEsXjifRA/ML3a3yM/e2Qy3 rVmmgFwv6QUZKq4h3NpzGRAs3RGIqqN86Z8VhuyWqTTrtky0/XGKiFYJgDdZeWtiG9M7 H8DYKlws2P74VQff1njtxTSmpkZ/eRdtohtCymjE6XrcXa8AlDHoffBUHfFHvQWPZspL T87Q== X-Gm-Message-State: AO0yUKW4YtU6F9AU93aXx9daXYpioe1nvT9LPS89uvzHpBBgT07/eat/ 1LEVOgyOJg3/wEpVFrinERA4jkboTQg1TV2QsQk4JUEyz19exxK8WiX9orT59p8UewoYmS6HzRq Rh8Tr1bZC1cOy6T/4/np+lDZM4nwPsKRXV23ZDUSGCpLpcsAuAqnQH3FANis24ETbKgsqDDLdrI U= X-Received: by 2002:a17:907:20f8:b0:88e:d435:3fd6 with SMTP id rh24-20020a17090720f800b0088ed4353fd6mr19600464ejb.63.1678351499799; Thu, 09 Mar 2023 00:44:59 -0800 (PST) X-Google-Smtp-Source: AK7set9Ml6R2GkLQZZ0T1DIRCoM/FIYIhMftcYzzNc50ajCs0/jSdLyN2rp3SsXdqYsQdh3Jrh4NWQ== X-Received: by 2002:a17:907:20f8:b0:88e:d435:3fd6 with SMTP id rh24-20020a17090720f800b0088ed4353fd6mr19600454ejb.63.1678351499430; Thu, 09 Mar 2023 00:44:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 1/9] vvfat: mark various functions as coroutine_fn Date: Thu, 9 Mar 2023 09:44:48 +0100 Message-Id: <20230309084456.304669-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351604283100003 Content-Type: text/plain; charset="utf-8" Functions that can do I/O are prime candidates for being coroutine_fns. Ma= ke the change for those that are themselves called only from coroutine_fns. In addition, coroutine_fns should do I/O using bdrv_co_*() functions, for which it is required to hold the BlockDriverState graph lock. So also nnot= ate functions on the I/O path with TSA attributes, making it possible to switch them to use bdrv_co_*() functions. Signed-off-by: Paolo Bonzini --- block/vvfat.c | 58 ++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index fd45e86416b2..0ddc91fc096a 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1053,7 +1053,7 @@ static BDRVVVFATState *vvv =3D NULL; #endif =20 static int enable_write_target(BlockDriverState *bs, Error **errp); -static int is_consistent(BDRVVVFATState *s); +static int coroutine_fn is_consistent(BDRVVVFATState *s); =20 static QemuOptsList runtime_opts =3D { .name =3D "vvfat", @@ -1469,8 +1469,8 @@ static void print_mapping(const mapping_t* mapping) } #endif =20 -static int vvfat_read(BlockDriverState *bs, int64_t sector_num, - uint8_t *buf, int nb_sectors) +static int coroutine_fn GRAPH_RDLOCK +vvfat_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_= sectors) { BDRVVVFATState *s =3D bs->opaque; int i; @@ -1490,8 +1490,8 @@ static int vvfat_read(BlockDriverState *bs, int64_t s= ector_num, DLOG(fprintf(stderr, "sectors %" PRId64 "+%" PRId64 " allocated\n", sector_num, n >> BDRV_SECTOR_BITS)); - if (bdrv_pread(s->qcow, sector_num * BDRV_SECTOR_SIZE, n, - buf + i * 0x200, 0) < 0) { + if (bdrv_co_pread(s->qcow, sector_num * BDRV_SECTOR_SIZE, = n, + buf + i * 0x200, 0) < 0) { return -1; } i +=3D (n >> BDRV_SECTOR_BITS) - 1; @@ -1532,7 +1532,7 @@ static int vvfat_read(BlockDriverState *bs, int64_t s= ector_num, return 0; } =20 -static int coroutine_fn +static int coroutine_fn GRAPH_RDLOCK vvfat_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { @@ -1796,8 +1796,8 @@ static inline uint32_t modified_fat_get(BDRVVVFATStat= e* s, } } =20 -static inline bool cluster_was_modified(BDRVVVFATState *s, - uint32_t cluster_num) +static inline bool coroutine_fn GRAPH_RDLOCK +cluster_was_modified(BDRVVVFATState *s, uint32_t cluster_num) { int was_modified =3D 0; int i; @@ -1852,8 +1852,8 @@ typedef enum { * Further, the files/directories handled by this function are * assumed to be *not* deleted (and *only* those). */ -static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s, - direntry_t* direntry, const char* path) +static uint32_t coroutine_fn GRAPH_RDLOCK +get_cluster_count_for_direntry(BDRVVVFATState* s, direntry_t* direntry, co= nst char* path) { /* * This is a little bit tricky: @@ -1979,9 +1979,9 @@ static uint32_t get_cluster_count_for_direntry(BDRVVV= FATState* s, if (res) { return -1; } - res =3D bdrv_pwrite(s->qcow, offset * BDRV_SECTOR_= SIZE, - BDRV_SECTOR_SIZE, s->cluster_buf= fer, - 0); + res =3D bdrv_co_pwrite(s->qcow, offset * BDRV_SECT= OR_SIZE, + BDRV_SECTOR_SIZE, s->cluster_= buffer, + 0); if (res < 0) { return -2; } @@ -2011,8 +2011,8 @@ static uint32_t get_cluster_count_for_direntry(BDRVVV= FATState* s, * It returns 0 upon inconsistency or error, and the number of clusters * used by the directory, its subdirectories and their files. */ -static int check_directory_consistency(BDRVVVFATState *s, - int cluster_num, const char* path) +static int coroutine_fn GRAPH_RDLOCK +check_directory_consistency(BDRVVVFATState *s, int cluster_num, const char= * path) { int ret =3D 0; unsigned char* cluster =3D g_malloc(s->cluster_size); @@ -2138,7 +2138,8 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); prin= t_direntry(direntries + i)) } =20 /* returns 1 on success */ -static int is_consistent(BDRVVVFATState* s) +static int coroutine_fn GRAPH_RDLOCK +is_consistent(BDRVVVFATState* s) { int i, check; int used_clusters_count =3D 0; @@ -2414,8 +2415,8 @@ static int commit_mappings(BDRVVVFATState* s, return 0; } =20 -static int commit_direntries(BDRVVVFATState* s, - int dir_index, int parent_mapping_index) +static int coroutine_fn GRAPH_RDLOCK +commit_direntries(BDRVVVFATState* s, int dir_index, int parent_mapping_ind= ex) { direntry_t* direntry =3D array_get(&(s->directory), dir_index); uint32_t first_cluster =3D dir_index =3D=3D 0 ? 0 : begin_of_direntry(= direntry); @@ -2504,8 +2505,8 @@ static int commit_direntries(BDRVVVFATState* s, =20 /* commit one file (adjust contents, adjust mapping), return first_mapping_index */ -static int commit_one_file(BDRVVVFATState* s, - int dir_index, uint32_t offset) +static int coroutine_fn GRAPH_RDLOCK +commit_one_file(BDRVVVFATState* s, int dir_index, uint32_t offset) { direntry_t* direntry =3D array_get(&(s->directory), dir_index); uint32_t c =3D begin_of_direntry(direntry); @@ -2770,7 +2771,7 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* = s) /* * TODO: make sure that the short name is not matching *another* file */ -static int handle_commits(BDRVVVFATState* s) +static int coroutine_fn GRAPH_RDLOCK handle_commits(BDRVVVFATState* s) { int i, fail =3D 0; =20 @@ -2913,7 +2914,7 @@ static int handle_deletes(BDRVVVFATState* s) * - recurse direntries from root (using bs->bdrv_pread) * - delete files corresponding to mappings marked as deleted */ -static int do_commit(BDRVVVFATState* s) +static int coroutine_fn GRAPH_RDLOCK do_commit(BDRVVVFATState* s) { int ret =3D 0; =20 @@ -2963,7 +2964,7 @@ DLOG(checkpoint()); return 0; } =20 -static int try_commit(BDRVVVFATState* s) +static int coroutine_fn GRAPH_RDLOCK try_commit(BDRVVVFATState* s) { vvfat_close_current_file(s); DLOG(checkpoint()); @@ -2972,8 +2973,9 @@ DLOG(checkpoint()); return do_commit(s); } =20 -static int vvfat_write(BlockDriverState *bs, int64_t sector_num, - const uint8_t *buf, int nb_sectors) +static int coroutine_fn GRAPH_RDLOCK +vvfat_write(BlockDriverState *bs, int64_t sector_num, + const uint8_t *buf, int nb_sectors) { BDRVVVFATState *s =3D bs->opaque; int i, ret; @@ -3082,8 +3084,8 @@ DLOG(checkpoint()); * Use qcow backend. Commit later. */ DLOG(fprintf(stderr, "Write to qcow backend: %d + %d\n", (int)sector_num, = nb_sectors)); - ret =3D bdrv_pwrite(s->qcow, sector_num * BDRV_SECTOR_SIZE, - nb_sectors * BDRV_SECTOR_SIZE, buf, 0); + ret =3D bdrv_co_pwrite(s->qcow, sector_num * BDRV_SECTOR_SIZE, + nb_sectors * BDRV_SECTOR_SIZE, buf, 0); if (ret < 0) { fprintf(stderr, "Error writing to qcow backend\n"); return ret; @@ -3103,7 +3105,7 @@ DLOG(checkpoint()); return 0; } =20 -static int coroutine_fn +static int coroutine_fn GRAPH_RDLOCK vvfat_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351630; cv=none; d=zohomail.com; s=zohoarc; b=WZbaq3FPoElSd7SDngolGdyE5aQT6tzaDVX5HMyUVfsP45hCviYhc/IYWN3HecZzrkjN1uV7bFWXHaSWKpt5duwsmW4m9AJV7bW66PxcG0Ip/FxmQNEfDFHr6VQJkrYMO8mMLP4Gk7rwbcHiiO0qRRT8M1/NugDJD5wMSPPXOcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351630; h=Content-Type: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=NXAux5UJetRfsyf7WlZWhWkdfnLmU2MPlX7G+HARLMM=; b=TXH8j3uEbd6FWexO5KS+PaExUMpB9QqJzGWxcFvXlckRWbxGkkpKEgOLG7Mr2SUShtJuX6b8T2d6Y8g0mMzm4e9yen0V6FCRAZ5GMBfZvzoZ8XEDqN1vbfBx1gDcRx1ePcjDI2fh7ZlBAJzU9bxGUzBlkfHr/ewOLMJa/qQ0f5A= 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+importer2=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 1678351630547164.99635134162497; Thu, 9 Mar 2023 00:47:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBte-0000Ff-Le; Thu, 09 Mar 2023 03:45:10 -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 1paBtc-0000ER-4C for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:08 -0500 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 1paBtZ-00006T-U0 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:07 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-6D90LHVDPXKP7MVhAk36xg-1; Thu, 09 Mar 2023 03:45:02 -0500 Received: by mail-ed1-f72.google.com with SMTP id b1-20020aa7dc01000000b004ad062fee5eso1848947edu.17 for ; Thu, 09 Mar 2023 00:45:02 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id y26-20020a170906519a00b008e53874f8d8sm8542526ejk.180.2023.03.09.00.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXAux5UJetRfsyf7WlZWhWkdfnLmU2MPlX7G+HARLMM=; b=UV5BZYrjaLPKhHxP3dB1TQuk88taGuP0CmL8NVIwTD+5zMkC90FNHZx9Pddfs065QxW5Jy JZcYopqapqRVW+v2CCE6dHu30lx/2vxUZY0+cp9T8zgr3YjHtSGhmUrlrcTFiotHKd+ZUC KrUqSj8lLTQz4RSHBOSblnfCJS8tY9M= X-MC-Unique: 6D90LHVDPXKP7MVhAk36xg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NXAux5UJetRfsyf7WlZWhWkdfnLmU2MPlX7G+HARLMM=; b=0qq05eeOWwaIrA6QAPyjFPM224nYYutiJdl+eYoP8j+gSQ2xy4NEUGYhMSUp+3lmbd ZHxuHpH426gmUmPw6rjF6Rp/wCdk7/XZhsHWccK+QX3GxIGvw0j1nyq3KOFu7kYfnPN/ y9udNuMVGVGWeh8P5wfofLxqegTXnDw2UKzN6HBrxwavLubLGriR5oWOia/hOdGwh8ic r2mdRXUC0GexkScCKr56sx+bIk7MI9l0khr1xIwJrkql/q6fBuSXTI18C6Os/d/7N0+g +O6UDl9tMSflPstajFBRzgw6GbNT6QwdvegeS8U5IeBnm06cUY7GDdwEYUMLDM5f4kk7 3P9A== X-Gm-Message-State: AO0yUKXDGm3NYPksvbNS3QTsNZxJKW38A95FfUHaUSoA6Saev+FqZ+m9 2kYljQNhzYr/QwsNh5vSJtihmBQBr9wVTWU5HLGSTf8P4eAA3Yh8CYMJaUQwMPmY+E5O3S6NJOw 9garHUeslmPP7ZBN4jNFk+drNZ9msDZgEjR/nmAMq3hle9lluavvbEIjSdPwSqAspC6pYMR7Xpc o= X-Received: by 2002:a17:906:550a:b0:8e6:1726:df82 with SMTP id r10-20020a170906550a00b008e61726df82mr17418039ejp.30.1678351501437; Thu, 09 Mar 2023 00:45:01 -0800 (PST) X-Google-Smtp-Source: AK7set+CzTLSH+/z4Ksw0pkfkURu3r5sriwaLywqTM8Md6wt/NRt1kfnzKnjz7Vcky+drQu5ogYDZQ== X-Received: by 2002:a17:906:550a:b0:8e6:1726:df82 with SMTP id r10-20020a170906550a00b008e61726df82mr17418027ejp.30.1678351501162; Thu, 09 Mar 2023 00:45:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 2/9] blkdebug: add missing coroutine_fn annotation Date: Thu, 9 Mar 2023 09:44:49 +0100 Message-Id: <20230309084456.304669-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351632418100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- block/blkdebug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 978c8cff9e33..addad914b3f7 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -583,8 +583,8 @@ out: return ret; } =20 -static int rule_check(BlockDriverState *bs, uint64_t offset, uint64_t byte= s, - BlkdebugIOType iotype) +static int coroutine_fn rule_check(BlockDriverState *bs, uint64_t offset, + uint64_t bytes, BlkdebugIOType iotype) { BDRVBlkdebugState *s =3D bs->opaque; BlkdebugRule *rule =3D NULL; --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351561; cv=none; d=zohomail.com; s=zohoarc; b=OzrY9PuBaPiPlf+dv0ElC39C1PFE72WimEvAyZR+jaR51JIhxp0Mi47hfYEHb5rvxNzerUOvb3TpjdkUjMLIgWOrETIg7Y5ISX5cEWxbOQ4pj01TmjDpSBiOfYgMdGbHheqLHwopATdFUn+NWCsYQrcZTX9ezC7bpx3MxfrReH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351561; h=Content-Type: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=6Wl4naTWDpzNgHd3paa7L+qCQhzgR6ZXg+piNeVf5U4=; b=axg/h8R1yLtVGpWX14hol698HxqLwFkcnmu9T8oRZQlZgkySekbMoB15uABhdatWX/Y+SF1UKs/LIcaYZocgDbKp9cNcpwavKu9CW8njpHcAE9YgT6ZZ70JPq9/M7t8JT882bh2ygxOOnn/oIExyaxnYnsJsrwTRnhU8ITJrhQM= 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+importer2=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 1678351561717764.7945044453944; Thu, 9 Mar 2023 00:46:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBte-0000Fd-Gq; Thu, 09 Mar 2023 03:45:10 -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 1paBtc-0000EW-Uc for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:08 -0500 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 1paBta-00006c-KR for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:08 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-Z9572B2aMIOJewZ3pDy-Cg-1; Thu, 09 Mar 2023 03:45:04 -0500 Received: by mail-ed1-f72.google.com with SMTP id ec11-20020a0564020d4b00b004e2cb85c8bcso1874330edb.16 for ; Thu, 09 Mar 2023 00:45:04 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id b9-20020a17090636c900b008c801141d58sm8570291ejc.109.2023.03.09.00.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Wl4naTWDpzNgHd3paa7L+qCQhzgR6ZXg+piNeVf5U4=; b=NZYwhJRiCrLnwc4CyYrKV7dk7YAp+MRpPFFNzivqChTiJw/TINTBqAtLiKZ+z9ECc/R6xN N/IghiMT52qwpQfYo6LQC9nWV8GGdvz8+oXTFfJTMRuzr6whPDML2u2lVe/yu6/Wtw3f6S A0jNH6jbKw+EYeq/sVdvZJHIA94aAAw= X-MC-Unique: Z9572B2aMIOJewZ3pDy-Cg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Wl4naTWDpzNgHd3paa7L+qCQhzgR6ZXg+piNeVf5U4=; b=ci9yGwc1A/orlIcn7Nl6apO1MmvkyEB870sxwrvwHluMPJUWMd+WU/a4FV8VHlMONx xU/oUiDPizQbFdD2tB/xSeCufAcL7i0dYQS4HpZFhgkGIIP27Y10/M478HqFCjEhQMqf tcsEDQeKxJHXqT/WHcmTq/scRuFbFOUM/v1KtPXwNCSCUwtWv4pu+EspowoC0vKGT7PN l6imxSwPUou0iih9CE1CxQtjMABh5hr601mbCcOK6goPuNqorM7znq34pYOzhTeHvbTZ UE1zHsM3qVK3I5KoHrk3kT8yaACHAORC7sgI6TEKLcddlZ4yH7uy92xD67c5AUUThqHD xEaA== X-Gm-Message-State: AO0yUKXhzE5aCxrG4UsUctojp3sHBqlGlJRjo8rMLAcFlcosMhNK1e2x QwHRqzZ55Cp2dyPgbGt0AaiJIAAAaka52OwMT0WGineunoz3XZaxM1PkVj6kOh+ADEZQLbEaOgW eod/A2m/rZOAEWCAY0FYcjn6F3I8+iRzJeoOprQkv2PVN1nnL1OYob8sbOsbICX3+e4k2rw1V96 w= X-Received: by 2002:a17:906:794e:b0:8df:e176:4837 with SMTP id l14-20020a170906794e00b008dfe1764837mr25661718ejo.19.1678351502928; Thu, 09 Mar 2023 00:45:02 -0800 (PST) X-Google-Smtp-Source: AK7set+8A55JeP2D90wY660Jy24uYfKqD892SggKuwBVnARREP3or3E2VtfjgJk6V2jUjK/8YvAl5Q== X-Received: by 2002:a17:906:794e:b0:8df:e176:4837 with SMTP id l14-20020a170906794e00b008dfe1764837mr25661701ejo.19.1678351502647; Thu, 09 Mar 2023 00:45:02 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 3/9] mirror: make mirror_flush a coroutine_fn, do not use co_wrappers Date: Thu, 9 Mar 2023 09:44:50 +0100 Message-Id: <20230309084456.304669-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351562164100001 Content-Type: text/plain; charset="utf-8" mirror_flush calls a mixed function blk_flush but it is only called from mirror_run; so call the coroutine version and make mirror_flush a coroutine_fn too. Signed-off-by: Paolo Bonzini --- block/mirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 663e2b700241..af9bbd23d4cf 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -886,9 +886,9 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJo= b *s) /* Called when going out of the streaming phase to flush the bulk of the * data to the medium, or just before completing. */ -static int mirror_flush(MirrorBlockJob *s) +static int coroutine_fn mirror_flush(MirrorBlockJob *s) { - int ret =3D blk_flush(s->target); + int ret =3D blk_co_flush(s->target); if (ret < 0) { if (mirror_error_action(s, false, -ret) =3D=3D BLOCK_ERROR_ACTION_= REPORT) { s->ret =3D ret; --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351582; cv=none; d=zohomail.com; s=zohoarc; b=huLkalk2/OS7Um2F9J0Q/kTCuYcxa+hlOwSi2joxWCTxgyWAMdLbMMbxZ0DTas/hLGsW9FUT0QsrfT6r1Fm0mJHIUzrD9Yug/bTqhAzNRkmQggxOZCVj0h2bK2y+Xo6z3CYrZ11ojx23/bgUhiyGTcpINx29Lsph1FgU96cfcJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351582; h=Content-Type: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=bm3j+ihvykJD0T4aa+ZsDucFY/2h63RFgZiBe6mcrsc=; b=nGZFhRSrg5SUwtp9VGqraFaXPn7d6GN98VlUbfnB+E0niRwB5ZO8PQjdMip6v7yHBRsqRrvO1UO1XqFLY1bTNEycYyByy9+s+msoIGkJAHoK6feXs3Wy17TTpu0Pem9YjvfFAvY/LrvcGZrQaoCWD3iYtfuiuyOBfJ4tWl19Py8= 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+importer2=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 1678351582702737.3251375752225; Thu, 9 Mar 2023 00:46:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBti-0000K7-Oq; Thu, 09 Mar 2023 03:45:14 -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 1paBte-0000Fk-Qw for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:10 -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 1paBtc-000084-Pd for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:10 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-382-xv7470mRMgC8oyzl9Yc7Rg-1; Thu, 09 Mar 2023 03:45:06 -0500 Received: by mail-ed1-f72.google.com with SMTP id ec11-20020a0564020d4b00b004e2cb85c8bcso1874440edb.16 for ; Thu, 09 Mar 2023 00:45:06 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id j22-20020a1709066dd600b008e6bd130b14sm8606891ejt.64.2023.03.09.00.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bm3j+ihvykJD0T4aa+ZsDucFY/2h63RFgZiBe6mcrsc=; b=FVzs9seamjPXiNr25XsEpNU0dlE3BO/fLqScorgRg9ptckG4PYHcdy0xpk2qJjb/eV0S8v uVQh2PyxZUWaogPl6xh2D5wTEP05jxAPFa419TD52fMYaoHMVmpfv7NzeQ9/s+1FSKg2aT IslXQNwxnJROlCpPBNO5OQdbMUVIX8g= X-MC-Unique: xv7470mRMgC8oyzl9Yc7Rg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bm3j+ihvykJD0T4aa+ZsDucFY/2h63RFgZiBe6mcrsc=; b=WcSGdPaES/xQ0XY7Pup9qromRa/vp0dEd8yFv4RJBd48tMu7JbyFtTSxrkKObQnB65 pNBcmwrq6Y65KDGiqyYqQoQUSTNdTSrLp5jyrWuuGUAAWnYEC5v69qylfxszK+p98wTk u+ifRV0/larlzdZiyEXQo1QrABqvyfovdFI3/SCtLX7fkREexqGbpv1sFWWGt3FlQJYH Tj2qzHoqCwySVCJYXJwAYXj4LVL4/IV/jdOkZCDbKGhlLKlZEWgd/RXxyOlZdBvMYSu1 CG+Kq1nIeVKz0YZfDhxXbBxgRteetxbLZiBZFbq4vN8Fmu7UB6vhdaDShN6BDM3MyMnq skNQ== X-Gm-Message-State: AO0yUKVlMGl3X7YdBovfg0xbhMDVxlkwts1M9kwsfePgl+7c6gOUJDd+ QNQ/pfGwux4flhtsqFIfSWlMQqkUzg+l+23nC64ldH4ikF9Mpqbp+a2OUuX5vw8zo0ok+5YW1p+ eltV7qT73MwbdmwE6xva6LzXrB75EjYSuIAc+5JZxJJ5OCn4y/mLHjK2N5I/LMpUZ3m8/zM5rgj 4= X-Received: by 2002:aa7:c589:0:b0:4af:6e08:319 with SMTP id g9-20020aa7c589000000b004af6e080319mr25220114edq.15.1678351504529; Thu, 09 Mar 2023 00:45:04 -0800 (PST) X-Google-Smtp-Source: AK7set+QQFrlxCsWYfm8HWluD7izv+UjbTGA0C4Ne+jCDcYHlS9r6JBio8Kx6ZkkGJyxb3+uCks9KQ== X-Received: by 2002:aa7:c589:0:b0:4af:6e08:319 with SMTP id g9-20020aa7c589000000b004af6e080319mr25220105edq.15.1678351504228; Thu, 09 Mar 2023 00:45:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 4/9] nbd: mark more coroutine_fns, do not use co_wrappers Date: Thu, 9 Mar 2023 09:44:51 +0100 Message-Id: <20230309084456.304669-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351584288100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- nbd/server.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index a4750e41880a..6f5fcade2a54 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1409,8 +1409,8 @@ nbd_read_eof(NBDClient *client, void *buffer, size_t = size, Error **errp) return 1; } =20 -static int nbd_receive_request(NBDClient *client, NBDRequest *request, - Error **errp) +static int coroutine_fn nbd_receive_request(NBDClient *client, NBDRequest = *request, + Error **errp) { uint8_t buf[NBD_REQUEST_SIZE]; uint32_t magic; @@ -1895,12 +1895,12 @@ static inline void set_be_simple_reply(NBDSimpleRep= ly *reply, uint64_t error, stq_be_p(&reply->handle, handle); } =20 -static int nbd_co_send_simple_reply(NBDClient *client, - uint64_t handle, - uint32_t error, - void *data, - size_t len, - Error **errp) +static int coroutine_fn nbd_co_send_simple_reply(NBDClient *client, + uint64_t handle, + uint32_t error, + void *data, + size_t len, + Error **errp) { NBDSimpleReply reply; int nbd_err =3D system_errno_to_nbd_errno(error); @@ -2038,8 +2038,8 @@ static int coroutine_fn nbd_co_send_sparse_read(NBDCl= ient *client, stl_be_p(&chunk.length, pnum); ret =3D nbd_co_send_iov(client, iov, 1, errp); } else { - ret =3D blk_pread(exp->common.blk, offset + progress, pnum, - data + progress, 0); + ret =3D blk_co_pread(exp->common.blk, offset + progress, pnum, + data + progress, 0); if (ret < 0) { error_setg_errno(errp, -ret, "reading from file failed"); break; @@ -2198,9 +2198,9 @@ static int coroutine_fn blockalloc_to_extents(BlockBa= ckend *blk, * @ea is converted to BE by the function * @last controls whether NBD_REPLY_FLAG_DONE is sent. */ -static int nbd_co_send_extents(NBDClient *client, uint64_t handle, - NBDExtentArray *ea, - bool last, uint32_t context_id, Error **err= p) +static int coroutine_fn nbd_co_send_extents(NBDClient *client, uint64_t ha= ndle, + NBDExtentArray *ea, + bool last, uint32_t context_id= , Error **errp) { NBDStructuredMeta chunk; struct iovec iov[] =3D { @@ -2277,10 +2277,10 @@ static void bitmap_to_extents(BdrvDirtyBitmap *bitm= ap, bdrv_dirty_bitmap_unlock(bitmap); } =20 -static int nbd_co_send_bitmap(NBDClient *client, uint64_t handle, - BdrvDirtyBitmap *bitmap, uint64_t offset, - uint32_t length, bool dont_fragment, bool la= st, - uint32_t context_id, Error **errp) +static int coroutine_fn nbd_co_send_bitmap(NBDClient *client, uint64_t han= dle, + BdrvDirtyBitmap *bitmap, uint64= _t offset, + uint32_t length, bool dont_frag= ment, bool last, + uint32_t context_id, Error **er= rp) { unsigned int nb_extents =3D dont_fragment ? 1 : NBD_MAX_BLOCK_STATUS_E= XTENTS; g_autoptr(NBDExtentArray) ea =3D nbd_extent_array_new(nb_extents); @@ -2297,8 +2297,8 @@ static int nbd_co_send_bitmap(NBDClient *client, uint= 64_t handle, * to the client (although the caller may still need to disconnect after * reporting the error). */ -static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request, - Error **errp) +static int coroutine_fn nbd_co_receive_request(NBDRequestData *req, NBDReq= uest *request, + Error **errp) { NBDClient *client =3D req->client; int valid_flags; @@ -2446,7 +2446,7 @@ static coroutine_fn int nbd_do_cmd_read(NBDClient *cl= ient, NBDRequest *request, data, request->len, errp); } =20 - ret =3D blk_pread(exp->common.blk, request->from, request->len, data, = 0); + ret =3D blk_co_pread(exp->common.blk, request->from, request->len, dat= a, 0); if (ret < 0) { return nbd_send_generic_reply(client, request->handle, ret, "reading from file failed", errp); @@ -2513,8 +2513,8 @@ static coroutine_fn int nbd_handle_request(NBDClient = *client, if (request->flags & NBD_CMD_FLAG_FUA) { flags |=3D BDRV_REQ_FUA; } - ret =3D blk_pwrite(exp->common.blk, request->from, request->len, d= ata, - flags); + ret =3D blk_co_pwrite(exp->common.blk, request->from, request->len= , data, + flags); return nbd_send_generic_reply(client, request->handle, ret, "writing to file failed", errp); =20 @@ -2529,8 +2529,8 @@ static coroutine_fn int nbd_handle_request(NBDClient = *client, if (request->flags & NBD_CMD_FLAG_FAST_ZERO) { flags |=3D BDRV_REQ_NO_FALLBACK; } - ret =3D blk_pwrite_zeroes(exp->common.blk, request->from, request-= >len, - flags); + ret =3D blk_co_pwrite_zeroes(exp->common.blk, request->from, reque= st->len, + flags); return nbd_send_generic_reply(client, request->handle, ret, "writing to file failed", errp); i --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351636; cv=none; d=zohomail.com; s=zohoarc; b=QxZ9L9F7ZHDEhU1v62jwc6BO9K40HhjB0V347kBBf62igAEEqz3N/KYMmNTjmty2E0i+iHmcaBR/SMlDH+Lrlj/Wmx8ZcTWklCJ373qBqeXVEIRV+HoG/fqslp/ldQSbWH9ADbFfl4ILJNsdZQhEpQU2P09v7pVUlYL5RxEkscY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351636; h=Content-Type: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=jzy0Dnxaju2oWytg1k07H+qcLnm0fKz+h4olkD7NQWM=; b=WShij6PcHOZbGL8AZBJV8oVjYKwLNkK5uaqjaDqthNcKqyyxqEA+frX2zfxEmKWHrEJ/mNgVmxD95Lz+gZR5xYFQcsV4hprnNfFKk8M+vwkfQ/6pk7uBHpjjSPRNfCOHBzxXSzq4CzDL1JQhf5UQU3Vabecd3R8LBQTM5eAi3V8= 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+importer2=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 1678351636597386.5917669666853; Thu, 9 Mar 2023 00:47:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBtj-0000Km-FU; Thu, 09 Mar 2023 03:45:15 -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 1paBth-0000JI-C5 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:13 -0500 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 1paBte-00009L-FP for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:13 -0500 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-223-iYhuMnzmODuqVK-ebBOdwg-1; Thu, 09 Mar 2023 03:45:07 -0500 Received: by mail-ed1-f70.google.com with SMTP id h15-20020a056402280f00b004bf9e193c23so1916412ede.11 for ; Thu, 09 Mar 2023 00:45:07 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id n24-20020a509358000000b004af5001c7ecsm9218807eda.12.2023.03.09.00.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jzy0Dnxaju2oWytg1k07H+qcLnm0fKz+h4olkD7NQWM=; b=AOTFxtXstemaQZ3/r0zRXy1bdY9y3yoBKkagVWA9LLqO3QGJgf0ATsBuYhfPxvee5pB2a2 q5HcES67lzai031EOZ5C0Ecly9z0XsIgyZVUNXzNaD1D5+uab2Hez4FQ5VuIm5sHQA8M4V 3hWSWfBf0qb9xtp3QHIt/Z+zKvG4oqc= X-MC-Unique: iYhuMnzmODuqVK-ebBOdwg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jzy0Dnxaju2oWytg1k07H+qcLnm0fKz+h4olkD7NQWM=; b=Qq/fMaeaQDAhN0GR3foyb4S1c317DJFTUFSrICsqCFEYap/pl0dbDpc+bHFapleLjo A4H+uFIYQCzoWCbWE9CqAg+EYJ5HBUVwvpo3x1xT9ioR6iahVvwelT2MHrBDHLqP81zt iNg755m/3UlNqC8lQ0wPyBKnBm/cUMx3XcBMNOvd0hJNZUQdEqvczE5x2wIuqNaIytE4 OzwliOmtLTVufyJg0X01VXVbwqndwk7vtahxZpBe1NnwyLl/recHwKOCMkXR8m8fjAvK U0oANkcpy9kzTD3QupFBFWqQXT9+sXnxnN4hfRunRJhBmdpLUKj9Z7IubTzS5S2uhgh1 yvWQ== X-Gm-Message-State: AO0yUKVCuDzG0TMsIzCEQTzzKxL5o1tm92VaJf+zyOYkbvs4w2SaLT5r nLvAQg5Qi2RtzzAr91pBNkzSFuuz2sWJepCpmjJFSsljQuczu4jipH6sYArJYc7C/luVdKpRBxa lDE/bzMr6ksmoaza6/JJ4AaTwSdyI+hSslTSi04NkD88sKp7szXKKR2NQ/Hgq1/PPZogmzxaYYj k= X-Received: by 2002:a05:6402:70f:b0:4af:7390:b488 with SMTP id w15-20020a056402070f00b004af7390b488mr20083986edx.40.1678351506187; Thu, 09 Mar 2023 00:45:06 -0800 (PST) X-Google-Smtp-Source: AK7set/3Q4Xo/vuRZw5/6S7LNvs+Cp2yRE1+6+9hc2ZXEazkiQLiqe2IXi9scSX6IDQ9gnRPYLhUjg== X-Received: by 2002:a05:6402:70f:b0:4af:7390:b488 with SMTP id w15-20020a056402070f00b004af7390b488mr20083974edx.40.1678351505912; Thu, 09 Mar 2023 00:45:05 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 5/9] 9pfs: mark more coroutine_fns Date: Thu, 9 Mar 2023 09:44:52 +0100 Message-Id: <20230309084456.304669-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351638424100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p.h | 4 ++-- hw/9pfs/codir.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 2fce4140d1e9..1b0d805b9c12 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -203,7 +203,7 @@ typedef struct V9fsDir { QemuMutex readdir_mutex_L; } V9fsDir; =20 -static inline void v9fs_readdir_lock(V9fsDir *dir) +static inline void coroutine_fn v9fs_readdir_lock(V9fsDir *dir) { if (dir->proto_version =3D=3D V9FS_PROTO_2000U) { qemu_co_mutex_lock(&dir->readdir_mutex_u); @@ -212,7 +212,7 @@ static inline void v9fs_readdir_lock(V9fsDir *dir) } } =20 -static inline void v9fs_readdir_unlock(V9fsDir *dir) +static inline void coroutine_fn v9fs_readdir_unlock(V9fsDir *dir) { if (dir->proto_version =3D=3D V9FS_PROTO_2000U) { qemu_co_mutex_unlock(&dir->readdir_mutex_u); diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 7ba63be489e7..0d0ffa1d2ba8 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -68,9 +68,9 @@ int coroutine_fn v9fs_co_readdir(V9fsPDU *pdu, V9fsFidSta= te *fidp, * * See v9fs_co_readdir_many() (as its only user) below for details. */ -static int do_readdir_many(V9fsPDU *pdu, V9fsFidState *fidp, - struct V9fsDirEnt **entries, off_t offset, - int32_t maxsize, bool dostat) +static int coroutine_fn do_readdir_many(V9fsPDU *pdu, V9fsFidState *fidp, + struct V9fsDirEnt **entries, off_t= offset, + int32_t maxsize, bool dostat) { V9fsState *s =3D pdu->s; V9fsString name; --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351652; cv=none; d=zohomail.com; s=zohoarc; b=TsA3VwYsHsScYhv1FjkcMBcnk97Jsfcg/mlsmtueZR2MDphG/8uTP7YM38g8UlebdoNiQgQTLFFMMoqydKAfgwLyXmHDAgH5g4gjbLa853p0otDKdE3hpJD9t+WCN6qqNyCyBaVA9gs9sF/eLzw2/QeNdMhOML+jt8L4f8G0o4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351652; h=Content-Type: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=cjNSXKxAYnFoc6sJxFxYTdlz4j0wHO1G3JZwgRMvpTo=; b=nlHmItxMN3u1Ppfk2jPnRniVetqdaY3+VkDEwjaQLFRFbJQ6KeuGkOtGKrSYAgg1VNSpaVFHt1e7RpoQmUob87nE+QfS9QWo2ClPU18j9dZLAbZZvjHLDnX4IkpoeIQC3HekkjpfELD3h2+vrYvLH/egHLO8fKhzJrJ1HEAhV7g= 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+importer2=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 167835165249524.664566258092464; Thu, 9 Mar 2023 00:47:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBtm-0000M0-Ht; Thu, 09 Mar 2023 03:45:18 -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 1paBti-0000K9-HM for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:14 -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 1paBtg-0000Cf-Bv for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:14 -0500 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-cRQ6lAalOH-SWwRlUl2Ssg-1; Thu, 09 Mar 2023 03:45:09 -0500 Received: by mail-ed1-f69.google.com with SMTP id ec11-20020a0564020d4b00b004e2cb85c8bcso1874611edb.16 for ; Thu, 09 Mar 2023 00:45:08 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id m30-20020a50d7de000000b004c13fe8fabfsm9248068edj.84.2023.03.09.00.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cjNSXKxAYnFoc6sJxFxYTdlz4j0wHO1G3JZwgRMvpTo=; b=a0SUGr7BKWqeYaDEB8kBRZaJb6PsHp5vNhXEEhtyZkD9e3tNw/G9GWWLz3tx5+iKxMDXc6 9kM2VBx5MD90UUeKyuq8J5aliM76ERIt6zudRxwZ309bqGt3WDlvwsbCk5OJUl6D0FrHpG +x+oblJA/uIdvR0VdZ5E+0hLe99Uks8= X-MC-Unique: cRQ6lAalOH-SWwRlUl2Ssg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cjNSXKxAYnFoc6sJxFxYTdlz4j0wHO1G3JZwgRMvpTo=; b=qhUd7s3XiSZnXH9JAw+msO6rK7ms6D8V9Ms+jtIfIcq5zPiBO4l7fSxRmzsRneYY/w 1t1LUwZE4DaEQ+SypsdCCjnoHE86uFEgvsGb54pwRXJ4y3Fm3g2kKJuom05ByH9rAXij xeifR3BoD5wzRWqT4YUvht4vBJYtErfndeIiP9cCfcLNFM019RnIqPgCafyBmdCoJ7DS Z7NnBsH7flyqt25sW5U2comcuZL5EgOpYsCGWi5RzzIe4G+Hl52qLQ5Kw1VzLsZFDGC0 GbraDdDhURN++GfsDJCz2c3axaCdT6S+QgPRQAMOpY5n5LdspYM1O1x0sMbm0zNn4R4t bOTg== X-Gm-Message-State: AO0yUKWZUnUTEmHuq305jgE4XCwlFGdNHjBbvas/0b9K7wIX6Ww0BXJJ USqSW94kDDYMvwF5cI/ZehIJHKtCSYQXPoWY4dpeFquaLbDEaO+iAZ+zJxCM1VTXz4wg39I0DKM ixKmR2V4nDdfOPKVsonPvsOIEjzhvcKyy2D8qUsAKXwmWU6KNwLJDQ462Qz3TwPtRMBPgXzdB9t E= X-Received: by 2002:a17:906:95c5:b0:8f0:4a90:a764 with SMTP id n5-20020a17090695c500b008f04a90a764mr23623134ejy.23.1678351507514; Thu, 09 Mar 2023 00:45:07 -0800 (PST) X-Google-Smtp-Source: AK7set9t+U2etUNTGW4eQfKtvyjvZ4k1eCvRokt2lBxwRjVi6tr/7Rhxxrqkssu0N8WmgYwTqO2a4g== X-Received: by 2002:a17:906:95c5:b0:8f0:4a90:a764 with SMTP id n5-20020a17090695c500b008f04a90a764mr23623122ejy.23.1678351507301; Thu, 09 Mar 2023 00:45:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 6/9] qemu-pr-helper: mark more coroutine_fns Date: Thu, 9 Mar 2023 09:44:53 +0100 Message-Id: <20230309084456.304669-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351654467100003 Content-Type: text/plain; charset="utf-8" do_sgio can suspend via the coroutine function thread_pool_submit_co, so it has to be coroutine_fn as well---and the same is true of all its direct and indirect callers. Signed-off-by: Paolo Bonzini --- scsi/qemu-pr-helper.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 199227a556e6..9df82d93a7d2 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -177,8 +177,8 @@ static int do_sgio_worker(void *opaque) return status; } =20 -static int do_sgio(int fd, const uint8_t *cdb, uint8_t *sense, - uint8_t *buf, int *sz, int dir) +static int coroutine_fn do_sgio(int fd, const uint8_t *cdb, uint8_t *sense, + uint8_t *buf, int *sz, int dir) { ThreadPool *pool =3D aio_get_thread_pool(qemu_get_aio_context()); int r; @@ -320,7 +320,7 @@ static SCSISense mpath_generic_sense(int r) } } =20 -static int mpath_reconstruct_sense(int fd, int r, uint8_t *sense) +static int coroutine_fn mpath_reconstruct_sense(int fd, int r, uint8_t *se= nse) { switch (r) { case MPATH_PR_SUCCESS: @@ -372,8 +372,8 @@ static int mpath_reconstruct_sense(int fd, int r, uint8= _t *sense) } } =20 -static int multipath_pr_in(int fd, const uint8_t *cdb, uint8_t *sense, - uint8_t *data, int sz) +static int coroutine_fn multipath_pr_in(int fd, const uint8_t *cdb, uint8_= t *sense, + uint8_t *data, int sz) { int rq_servact =3D cdb[1]; struct prin_resp resp; @@ -427,8 +427,8 @@ static int multipath_pr_in(int fd, const uint8_t *cdb, = uint8_t *sense, return mpath_reconstruct_sense(fd, r, sense); } =20 -static int multipath_pr_out(int fd, const uint8_t *cdb, uint8_t *sense, - const uint8_t *param, int sz) +static int coroutine_fn multipath_pr_out(int fd, const uint8_t *cdb, uint8= _t *sense, + const uint8_t *param, int sz) { int rq_servact =3D cdb[1]; int rq_scope =3D cdb[2] >> 4; @@ -545,8 +545,8 @@ static int multipath_pr_out(int fd, const uint8_t *cdb,= uint8_t *sense, } #endif =20 -static int do_pr_in(int fd, const uint8_t *cdb, uint8_t *sense, - uint8_t *data, int *resp_sz) +static int coroutine_fn do_pr_in(int fd, const uint8_t *cdb, uint8_t *sens= e, + uint8_t *data, int *resp_sz) { #ifdef CONFIG_MPATH if (is_mpath(fd)) { @@ -563,8 +563,8 @@ static int do_pr_in(int fd, const uint8_t *cdb, uint8_t= *sense, SG_DXFER_FROM_DEV); } =20 -static int do_pr_out(int fd, const uint8_t *cdb, uint8_t *sense, - const uint8_t *param, int sz) +static int coroutine_fn do_pr_out(int fd, const uint8_t *cdb, uint8_t *sen= se, + const uint8_t *param, int sz) { int resp_sz; =20 --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351639; cv=none; d=zohomail.com; s=zohoarc; b=eJnAMM7akR7YwvGdae6xPU00zhMLP+jvx0ciSKgZOhVOWayNIBEC84x63Nr6f/5cst5R9kuo1H9DniDCMnW4EYAbc8Uye468y0BDDmgOtG/gd9/3Yrkp59raSKzEMfqcXBpu29rxLvIXga/e4y/V9CtDtojscZJdsfcP/eBDGTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351639; h=Content-Type: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=l5cdLVRYibCexX5z7fj2qq9ISnkCMmfES7H7wn1Me+4=; b=G5ffhrzRT1TACbxp1PPUqyj1XIiwWZrLDi6oIXVG4WF3q5eql/lCIVXtRKNLmI4qsxNJgQnn4hXxKftX/Je0kxPv+GphnZ0KG3AVq+uIW/wrzYeekxxwvjyzLUjXfvEmX1S1iWc6q9ZJauUZYZnCz3SndG7rcN9bTqnt/y9l6jc= 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+importer2=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 1678351639341724.7616035222197; Thu, 9 Mar 2023 00:47:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBtl-0000Lt-8e; Thu, 09 Mar 2023 03:45:17 -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 1paBth-0000JS-L7 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:13 -0500 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 1paBtg-0000Aw-2u for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:13 -0500 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-hMbpGvIeMZOKtJeXYrZYYA-1; Thu, 09 Mar 2023 03:45:10 -0500 Received: by mail-ed1-f69.google.com with SMTP id da22-20020a056402177600b004c60694083eso1902376edb.5 for ; Thu, 09 Mar 2023 00:45:10 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id dc23-20020a170906c7d700b008b17e55e8f7sm8502061ejb.186.2023.03.09.00.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l5cdLVRYibCexX5z7fj2qq9ISnkCMmfES7H7wn1Me+4=; b=F//0lzTFfOHxCFUrgzDkJNqNCCaEMMFWlt4qbbQNUzElLrGGYB27hnrTcwOfbTcLmguFhj /jDJwt8Rvok2ZjnQh1BcwZ6xMhz3x4SYnNs9+E3FsKjRmoONDfOF/1Zm1L5I7PlC0EkZG3 /ts84u2nUGNNnKLWlPlTqDEJrfVKlfw= X-MC-Unique: hMbpGvIeMZOKtJeXYrZYYA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351509; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l5cdLVRYibCexX5z7fj2qq9ISnkCMmfES7H7wn1Me+4=; b=6Rn5dJPMIkuCgCnWWDXuQHb+NlyZSB4gBfZfWPPlyXW8EqPI4OxPZgDItuhN9+ZDCf zRqxX/yq45Uo3r6CEUzhNink1NG/fYGQ7AIW4RRweW95AcVY4BaRKyIkmpz6U9o7tHF+ a6m12nZTz56ljq8/dnxgWfB13p2F12UJxAzxxZU4CoVaAhAqleGDcXkX/xQmbyLyaHB7 jD/VJPolEU3QRxjJlERDbmmEHnPosIjKKdqc7hRB2gjOFG/MLZ9rMlTLLPYnBKvTqvvL OzZfI/JXfX6ZbDzS3+YD7lyFqhmrKeIcla56d5fMno8cVMzHDMxqx2Ga8Tcp7GzDK3n3 g7NQ== X-Gm-Message-State: AO0yUKWe6fdh136Td1wz6QUzNAgXSFbnnVdBO2wdjWLm6GRbRAYiaudZ 5JINkfGGdj5bOmTaCyPHwAHxh5fqEr/BL/SwGz2q0rNMXWkSjDpLNrmkaTs4WDn3B+B4Pmbc0y4 VYr3Zn0cSKrvRaUW/iRnUS13SeJfQdKvQguer+wdJ9DinVEo0w3dTvUF1+mj52fCl4Qh+edL6HE Q= X-Received: by 2002:a17:907:3f90:b0:8ec:439f:18fb with SMTP id hr16-20020a1709073f9000b008ec439f18fbmr21910761ejc.29.1678351508900; Thu, 09 Mar 2023 00:45:08 -0800 (PST) X-Google-Smtp-Source: AK7set8mPkYRW4PsdTEZ9LMiDHwYHUk0AetiDxxjpCfIunggztT1fg8XfW3vy8cWpvU3igiPsDntXQ== X-Received: by 2002:a17:907:3f90:b0:8ec:439f:18fb with SMTP id hr16-20020a1709073f9000b008ec439f18fbmr21910751ejc.29.1678351508723; Thu, 09 Mar 2023 00:45:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 7/9] tests: mark more coroutine_fns Date: Thu, 9 Mar 2023 09:44:54 +0100 Message-Id: <20230309084456.304669-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351640395100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- tests/unit/test-thread-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-thread-pool.c b/tests/unit/test-thread-pool.c index 6020e65d6986..493b966b94f9 100644 --- a/tests/unit/test-thread-pool.c +++ b/tests/unit/test-thread-pool.c @@ -71,7 +71,7 @@ static void test_submit_aio(void) g_assert_cmpint(data.ret, =3D=3D, 0); } =20 -static void co_test_cb(void *opaque) +static void coroutine_fn co_test_cb(void *opaque) { WorkerTestData *data =3D opaque; =20 --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351564; cv=none; d=zohomail.com; s=zohoarc; b=NOW33LsnWhgOZhM5TkfyFZp1kRqQlqZLCnhBnALMljCfGcTAu7mmZmQoLsPkNbbCAhJhcwC+ysBhbGjJ0ohsZYHv6zTSHfPkvtRBJZQxVZVCM0ag5FiptUTFlVe9bQJCHS2q5JGwAbSjYHiuG9RCsCHdRayZbDfcKwpa96H3//A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351564; h=Content-Type: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=/DdPD1vC2WnPMDOn3ShBOi1jN3amrU83BUcKpcp7WWI=; b=IVf7YH1lV5s1/UldMLXtg+l2FP7K1vbuwk0IqdENmZ7y/eq9YC2PcnaY7bbtBkmrnW5Z+VLQoXYc5PhAfuodnVdT9rgBxdXLoR8aTs896oS1WuKCqaa6T6B2juLIM9p2qU6Ybz8XiFenTuTPWoagNirUnl50LoavcVRy37tNQeI= 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+importer2=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 1678351564877918.535696297255; Thu, 9 Mar 2023 00:46:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBtn-0000NX-Mz; Thu, 09 Mar 2023 03:45:19 -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 1paBtm-0000MN-Ak for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:18 -0500 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 1paBti-0000FA-O2 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:17 -0500 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-kCRZohQeMsyHVFtucBUgQQ-1; Thu, 09 Mar 2023 03:45:11 -0500 Received: by mail-ed1-f70.google.com with SMTP id da22-20020a056402177600b004c60694083eso1902476edb.5 for ; Thu, 09 Mar 2023 00:45:11 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id ca5-20020a170906a3c500b008bc2c2134c5sm8548635ejb.216.2023.03.09.00.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/DdPD1vC2WnPMDOn3ShBOi1jN3amrU83BUcKpcp7WWI=; b=GZlRUgEe5rpQHqCjuQGYiDzIsLqO6Pi92rl2aId5VTzEICHKeoSdPcAUIhj4JqZJU/zC62 WoP74OZ9MP6QzA8szWJmNNJZx22nL40tNYRGnUtl5JmEdH5hSBWfacjclYKDQdSqjQE7GJ 0340KygbIEYw0swieylCRqU4ozYd53Y= X-MC-Unique: kCRZohQeMsyHVFtucBUgQQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351510; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/DdPD1vC2WnPMDOn3ShBOi1jN3amrU83BUcKpcp7WWI=; b=j32cvjoCKyMegAtLENTfox48pNCzKDXYgZiyvebqT0ukMMjuPJsq90Cb3fj2J3INpS 4il4GH5ipswUYUSyEtfqsxbwdega5Nu4ocsE9moF12ecbcAmdQRfgd6tUS9hY1GRnvLL +sEH//utnVIKN35iVVHNaQVeqhTT/r7zRKKQQZPk5pu8JwK18VpOaQCBnjO76jU5ViOU m7PJ0xW5SdetbE7jxE9wEF+jtqAYwu9zbkKA8/kCIT9rpgQdve4B5Dofu/MCx1tSg19C YV/PjL0JQSYpEWAFdTooLtxzbbehalPDj9rAVkm/vgGmy3pABwS7cDus7vjlb4xMWKhg 3bOQ== X-Gm-Message-State: AO0yUKV0k3YN7fA6o6rAWbgS8uriansHW+WERe7mfTOpsovT6eCQy4Tx HAk9OxVq3QmgEshiSDILEQb6ySorRrglhWoZ68vIOIMSQJfQc9P83vJcF8ZWmyV5h7IKYbClX0M EfJK7mxOnwzpT/Vg1Nebo8sS+3dET5ujmi5M8DbBi2+pWXKUJjZJethXtIsTMLaUWUrn/TXWXXP U= X-Received: by 2002:a05:6402:31fb:b0:4ac:c3c0:24d7 with SMTP id dy27-20020a05640231fb00b004acc3c024d7mr20985010edb.42.1678351510437; Thu, 09 Mar 2023 00:45:10 -0800 (PST) X-Google-Smtp-Source: AK7set/rYrNtLbS0wIR1Bw8vUQ9Ha4T7iPWPSVfV5P3t/1FPukwU396HXObXg8OD+6fRfSsQw8Dabg== X-Received: by 2002:a05:6402:31fb:b0:4ac:c3c0:24d7 with SMTP id dy27-20020a05640231fb00b004acc3c024d7mr20984996edb.42.1678351510059; Thu, 09 Mar 2023 00:45:10 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 8/9] qcow2: mark various functions as coroutine_fn and GRAPH_RDLOCK Date: Thu, 9 Mar 2023 09:44:55 +0100 Message-Id: <20230309084456.304669-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351566165100007 Content-Type: text/plain; charset="utf-8" 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 --- block/qcow2-bitmap.c | 2 +- block/qcow2-cluster.c | 20 ++++++++++++-------- block/qcow2-refcount.c | 8 ++++---- block/qcow2-snapshot.c | 25 +++++++++++++------------ block/qcow2.c | 26 +++++++++++++------------- block/qcow2.h | 15 ++++++++------- 6 files changed, 51 insertions(+), 45 deletions(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 5f456a2785c6..a952fd58d85e 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 a9e6622fe300..92526dea504c 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,8 @@ 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 b092f89da98b..b2a81ff707ab 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 62e8a0335d44..90fac35920b6 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 GRAPH_RDLOCK qcow2_read_snapshots(BlockDriverState *bs, E= rror **errp) { return qcow2_do_read_snapshots(bs, false, NULL, NULL, errp); } diff --git a/block/qcow2.c b/block/qcow2.c index 30fd53fa64bc..258bf11394ab 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,8 @@ 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; diff --git a/block/qcow2.h b/block/qcow2.h index c59e33c01cc9..c75decc38ad1 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); --=20 2.39.2 From nobody Wed May 8 23:20:31 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678351585; cv=none; d=zohomail.com; s=zohoarc; b=cAYftUDkKT0Hd/7muaKt+Rv3WREEiQxalAhsd1Y4gMG1bAHtVwFvsLeyvMFWelgcRRk3iOqmgJfbDQ7roIU5gLYhA2divVdkmFf9N9zq6GgyGicqHw1osBnK1W8mC/e91AL4i872hDX5IC6oU7DleQSxriFHsjtHadeEVLmWOXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678351585; h=Content-Type: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=9BNYsD2O42o1OGGl2m4moWLqOlHFxw13TgG0AXas3Mw=; b=cwNvlNsK+yY/k1E0BKXzYEa8fR4+xBcyAEoqDGqPByvBf3sa4LG4YOUDFA/x2RUhqCHDZDrpD2e8jsEOxyeSfz8z+heOvZtc69gO0z8rfE0qqO1AnEW4aWNC5VKew8KGgHl/DUB8mVOCsBkGjbqhHy0ZqqeEEYW9mTDBzLPIMpM= 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+importer2=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 167835158575088.64235316358156; Thu, 9 Mar 2023 00:46:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paBtn-0000NU-GZ; Thu, 09 Mar 2023 03:45:19 -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 1paBtk-0000Ll-PA for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:16 -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 1paBtj-0000Fs-BQ for qemu-devel@nongnu.org; Thu, 09 Mar 2023 03:45:16 -0500 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-1oQ4G6cwMP6QRjJntdLQbw-1; Thu, 09 Mar 2023 03:45:13 -0500 Received: by mail-ed1-f72.google.com with SMTP id fi8-20020a056402550800b004a26cc7f6cbso1925019edb.4 for ; Thu, 09 Mar 2023 00:45:13 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id u9-20020a170906068900b008d02b6f3f41sm8560683ejb.211.2023.03.09.00.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 00:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678351514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9BNYsD2O42o1OGGl2m4moWLqOlHFxw13TgG0AXas3Mw=; b=LhKNMjFb0IjqMuhTqy8d4dCIudvTnzCJPXEaE4oyFY/YwWotHYElmjiNquLygtBA97dVr7 1Bb9DwrZN69KWBsgXKFVx6mzjIM7vhB7GAV1gZnA1HnchEtAbVmDsLqMDsFhkyYux+OjvO mU96chedXAuci5v+JFysj22fLOFQH1A= X-MC-Unique: 1oQ4G6cwMP6QRjJntdLQbw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678351511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9BNYsD2O42o1OGGl2m4moWLqOlHFxw13TgG0AXas3Mw=; b=iCgxWjBqVpsLPVoG9La8t7kuWYhZCteP4KeHcW6FuGP69AbHotFJ1jIqBX8hT1Kub6 3pF9Or/LBbNRI6GAVIzdBprPOb9W1gBvyHJVNSnXu0vpCZPjaTLG58ZSwCpHjzmcdhGW 4i3VRdTbQ+R95Z64wiBn7JXrF1USwFAb+LUi8zFgbiS6GBesqE8kvHo9ATmJevl6Fyu2 mAUuzUdjypRPNS1PjmA9u5+SfXwmUEs8GgoqWtmNL4SMZdzjuOQ2Q4J0/Z/BfJFoPVAg NBpxmPzWAaoCY/vs/rNRXtNlJ1YcAE6Fifr/XsnFzRKw/xtiqQ8SbK24yZeItYbCodTx KeKw== X-Gm-Message-State: AO0yUKW4vxgba3SdOHEd/nDl2LscuETtGkkDH1otoWKQpCkETcCTyXQa Omg5i3Vc0p0rqldaytYPLHcO1l1lxfrb4RincSXRgRnFWtPAyNYi5JdgIEIfoDIQ1dXR0PJuRkq 9NuQFs5RfGF3OL3YkvjPqO1BicMhhA58eua7xNTK6VmXh5x/500+M41I//4VkU7G2KYj7EaVxgQ o= X-Received: by 2002:a17:906:5daa:b0:8f4:5bda:b755 with SMTP id n10-20020a1709065daa00b008f45bdab755mr15751759ejv.4.1678351511796; Thu, 09 Mar 2023 00:45:11 -0800 (PST) X-Google-Smtp-Source: AK7set+oOK9Zpkj0eryVe1FtfTnj41I8txV+Z6d5RmgJXZalLf0dQ/8AFhWIdquQylTVgoSBXbjwrA== X-Received: by 2002:a17:906:5daa:b0:8f4:5bda:b755 with SMTP id n10-20020a1709065daa00b008f45bdab755mr15751747ejv.4.1678351511529; Thu, 09 Mar 2023 00:45:11 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Subject: [PATCH 9/9] vmdk: make vmdk_is_cid_valid a coroutine_fn Date: Thu, 9 Mar 2023 09:44:56 +0100 Message-Id: <20230309084456.304669-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309084456.304669-1-pbonzini@redhat.com> References: <20230309084456.304669-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678351586221100005 Content-Type: text/plain; charset="utf-8" Functions that can do I/O are prime candidates for being coroutine_fns. Ma= ke the change for the one that is itself called only from coroutine_fns. Unfortun= ately vmdk does not use a coroutine_fn for the bulk of the open (like qcow2 does)= so vmdk_read_cid cannot have the same treatment. Signed-off-by: Paolo Bonzini --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index f5f49018fe4a..3f8c731e32e8 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -376,7 +376,7 @@ out: return ret; } =20 -static int vmdk_is_cid_valid(BlockDriverState *bs) +static int coroutine_fn vmdk_is_cid_valid(BlockDriverState *bs) { BDRVVmdkState *s =3D bs->opaque; uint32_t cur_pcid; --=20 2.39.2