From nobody Thu Dec 18 14:12:57 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=1656762538; cv=none; d=zohomail.com; s=zohoarc; b=O8k/bFo62VJOxyXoE6Cz4tbKlaXGyljnSBPknOT4YvZFgvaMn/SMjJBi5vLW3asRCanOuj+bZdC8jwc9Hxj6n0mLuMoKi+mo6lWpTmS1kVvypqy5Ar94LFzgIY2GMzv07vZxNPTe4f11xddMVM4+7SeOZ5uJnXdl4j0lezlJVcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656762538; 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=6ucg/IwUXXbiD7o0QoLNGNJZ5xaPheNGQ2/axa9ThQo=; b=Zu2rMDmGtIxL8ktlRyOTDOOo/toK7oirtfmMrTTVaMc7cPFxEhfxxUIukaO4rpATm6U2shrlz4O0FBzenMNy2QdoZxuMmpyXzXQd+oGKiwdscFu6xxFlgLAprTkuQJV+Uq7CqoRXDcjl+9Ex9ROsPlUDwaFhO0WUUXPFBw2mhwA= 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 1656762538671559.1745339586042; Sat, 2 Jul 2022 04:48:58 -0700 (PDT) Received: from localhost ([::1]:53934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7bcO-0002Xy-VN for importer@patchew.org; Sat, 02 Jul 2022 07:48:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7bO7-0003W4-KY for qemu-devel@nongnu.org; Sat, 02 Jul 2022 07:34:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7bO5-00080i-LP for qemu-devel@nongnu.org; Sat, 02 Jul 2022 07:34:11 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-529-XcNUMVLgPGiEUg1gD9Fgiw-1; Sat, 02 Jul 2022 07:34:05 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 584FC1C068E2; Sat, 2 Jul 2022 11:34:05 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.194.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3161F492C3B; Sat, 2 Jul 2022 11:34:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656761649; 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=6ucg/IwUXXbiD7o0QoLNGNJZ5xaPheNGQ2/axa9ThQo=; b=hC0qKsbsL+bG+PT0cmCyi8sja0NlUtXmZdVJo83wlQkhOfzW+Ymwy09hLPKF/hM3WCtHjr UCm8b27OW9CPB3wRjCZS8w/xTcdhra6Sl6zEApGpeAoCmtZIjKQ35YBZdpbdyocjUuoacR B05B2x2o/bIXCRAFG3V/cQUFUYHdRVs= X-MC-Unique: XcNUMVLgPGiEUg1gD9Fgiw-1 From: Alberto Faria To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-block@nongnu.org, "Denis V. Lunev" , Emanuele Giuseppe Esposito , Stefan Hajnoczi , Ronnie Sahlberg , Hanna Reitz , Stefano Garzarella , Kevin Wolf , Peter Xu , Alberto Garcia , John Snow , Eric Blake , Fam Zheng , Markus Armbruster , Vladimir Sementsov-Ogievskiy , Peter Lieven , Alberto Faria Subject: [RFC 8/8] Avoid calls from coroutine_fn to no_coroutine_fn Date: Sat, 2 Jul 2022 12:33:31 +0100 Message-Id: <20220702113331.2003820-9-afaria@redhat.com> In-Reply-To: <20220702113331.2003820-1-afaria@redhat.com> References: <20220702113331.2003820-1-afaria@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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=afaria@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656762539467100001 Content-Type: text/plain; charset="utf-8" These calls were found by static-analyzer.py. Signed-off-by: Alberto Faria --- block/block-backend.c | 2 +- block/io.c | 10 +++++----- block/parallels.c | 4 ++-- block/qcow2-refcount.c | 2 +- block/qed-table.c | 2 +- block/qed.c | 2 +- block/vmdk.c | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 5f2a912a59..8fa48576cd 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1395,7 +1395,7 @@ static int coroutine_fn blk_pwritev_part(BlockBackend= *blk, int64_t offset, int ret; =20 blk_inc_in_flight(blk); - ret =3D blk_do_pwritev_part(blk, offset, bytes, qiov, qiov_offset, fla= gs); + ret =3D blk_co_do_pwritev_part(blk, offset, bytes, qiov, qiov_offset, = flags); blk_dec_in_flight(blk); =20 return ret; diff --git a/block/io.c b/block/io.c index bbfe94503b..832bccd31e 100644 --- a/block/io.c +++ b/block/io.c @@ -2781,8 +2781,8 @@ int coroutine_fn bdrv_co_is_zero_fast(BlockDriverStat= e *bs, int64_t offset, return 1; } =20 - ret =3D bdrv_common_block_status_above(bs, NULL, false, false, offset, - bytes, &pnum, NULL, NULL, NULL); + ret =3D bdrv_co_common_block_status_above(bs, NULL, false, false, offs= et, + bytes, &pnum, NULL, NULL, NULL= ); =20 if (ret < 0) { return ret; @@ -2798,9 +2798,9 @@ int coroutine_fn bdrv_is_allocated(BlockDriverState *= bs, int64_t offset, int64_t dummy; IO_CODE(); =20 - ret =3D bdrv_common_block_status_above(bs, bs, true, false, offset, - bytes, pnum ? pnum : &dummy, NULL, - NULL, NULL); + ret =3D bdrv_co_common_block_status_above(bs, bs, true, false, offset, + bytes, pnum ? pnum : &dummy, N= ULL, + NULL, NULL); if (ret < 0) { return ret; } diff --git a/block/parallels.c b/block/parallels.c index 8879b7027a..22c59a1ee2 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -503,8 +503,8 @@ static int coroutine_fn parallels_co_check(BlockDriverS= tate *bs, * In order to really repair the image, we must shrink it. * That means we have to pass exact=3Dtrue. */ - ret =3D bdrv_truncate(bs->file, res->image_end_offset, true, - PREALLOC_MODE_OFF, 0, &local_err); + ret =3D bdrv_co_truncate(bs->file, res->image_end_offset, true, + PREALLOC_MODE_OFF, 0, &local_err); if (ret < 0) { error_report_err(local_err); res->check_errors++; diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index ed0ecfaa89..e30fd38e14 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1233,7 +1233,7 @@ int coroutine_fn qcow2_flush_caches(BlockDriverState = *bs) return ret; } =20 - return bdrv_flush(bs->file->bs); + return bdrv_co_flush(bs->file->bs); } =20 /*********************************************************/ diff --git a/block/qed-table.c b/block/qed-table.c index 1cc844b1a5..aa203f2627 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -100,7 +100,7 @@ static int coroutine_fn qed_write_table(BDRVQEDState *s= , uint64_t offset, } =20 if (flush) { - ret =3D bdrv_flush(s->bs); + ret =3D bdrv_co_flush(s->bs); if (ret < 0) { goto out; } diff --git a/block/qed.c b/block/qed.c index 96f4cda83f..dc9f065c02 100644 --- a/block/qed.c +++ b/block/qed.c @@ -490,7 +490,7 @@ static int coroutine_fn bdrv_qed_do_open(BlockDriverSta= te *bs, QDict *options, } =20 /* From here on only known autoclear feature bits are valid */ - bdrv_flush(bs->file->bs); + bdrv_co_flush(bs->file->bs); } =20 s->l1_table =3D qed_alloc_table(s); diff --git a/block/vmdk.c b/block/vmdk.c index 38e5ab3806..5c94a2f27c 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -2150,8 +2150,8 @@ vmdk_co_pwritev_compressed(BlockDriverState *bs, int6= 4_t offset, int64_t bytes, return length; } length =3D QEMU_ALIGN_UP(length, BDRV_SECTOR_SIZE); - ret =3D bdrv_truncate(s->extents[i].file, length, false, - PREALLOC_MODE_OFF, 0, NULL); + ret =3D bdrv_co_truncate(s->extents[i].file, length, false, + PREALLOC_MODE_OFF, 0, NULL); if (ret < 0) { return ret; } --=20 2.36.1