From patchwork Thu Sep 22 08:48:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=alK040Uc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8QK6Rttz1yqL for ; Thu, 22 Sep 2022 19:00:56 +1000 (AEST) Received: from localhost ([::1]:52476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obI4j-0004A0-8G for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:00:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtn-0004HH-Hk for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtj-000372-TG for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836570; 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=LXUPCEKsOWKG9QuHsF9Ng0OAJFz0RxXDrXgSaXJGzLc=; b=alK040UcuVSRE5ufVMD9plwMPDUuATRf1Zm/0uwd5LbQOf/jupIw+4S3Oe26Woex3KTVn8 6+yESY3gDEW83cVjfRQ6O6OhBpW/P/3nzC2eRpodAeAwdBTmEcCR2+MuHuUCWAlqJsJG8w uaZCt1hCx5REMYQpIuJPdUtxN2AQwcU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-369-c_sh_XnTPMOygnDKkP1Cdw-1; Thu, 22 Sep 2022 04:49:29 -0400 X-MC-Unique: c_sh_XnTPMOygnDKkP1Cdw-1 Received: by mail-ej1-f69.google.com with SMTP id sh31-20020a1709076e9f00b00781c4e720feso3758293ejc.8 for ; Thu, 22 Sep 2022 01:49:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=LXUPCEKsOWKG9QuHsF9Ng0OAJFz0RxXDrXgSaXJGzLc=; b=IsZW2XncnvW4VcuCOoD6Jv9RKC5ilBZa/VTCEQqfRvUXR9luKUfgvpMXw3EKrjloco ti59DZCJhSeBkYxTcTfsCZx0ePeAkFZ6LK1N0/cydims/NxIagAAX4nE9EhAd5HvPSNl dmstHreU2MeBydmCL8RzDLEPeZI06yzoRq6GN5If5unzikM6SsYDeFavKGTWVjQxdvuN V/POHsFPB7QKeaaPS8ulA5JRONjuwAsmHyfoqHu2A+2AfYhFSF3oeSX7hVp8aJRNtDx0 MM9XFe0skvXMKuBSalUy1j4YCo11NbaQfDjYe9gPcPfihc/sYbvo5hGtNGmuFusKuid1 ZiUg== X-Gm-Message-State: ACrzQf32YrVWGc2lowzRPzuCkPdizHvqlA8RrwTZrZ4EZB9jOh5fOLdx DkaeTZB4ACfyKjhfz3VPwWTnEVIf9xZXn8mtU2FbVZ2KaoLbZPWvV4KS1eKeWaZyNd1q6h1Lraa E/TEUq9f/U5BFEVGFz5ddtLy5uo0ZQKwfhygu6hC5RY687aIFuTAIZFBFRBvaLXSjoj8= X-Received: by 2002:aa7:cb4f:0:b0:453:88d0:bed0 with SMTP id w15-20020aa7cb4f000000b0045388d0bed0mr2135427edt.127.1663836567436; Thu, 22 Sep 2022 01:49:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77RCRb22hM+UzOgb3JVupCTDDGnUrz21Q1jonC9M5Sc5ud7ZLtmrDKndsxrrndSynL2cA+4Q== X-Received: by 2002:aa7:cb4f:0:b0:453:88d0:bed0 with SMTP id w15-20020aa7cb4f000000b0045388d0bed0mr2135407edt.127.1663836567217; Thu, 22 Sep 2022 01:49:27 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id d22-20020a056402079600b0044625884285sm3228003edy.49.2022.09.22.01.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 01/26] block/nvme: separate nvme_get_free_req cases for coroutine/non-coroutine context Date: Thu, 22 Sep 2022 10:48:59 +0200 Message-Id: <20220922084924.201610-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" nvme_get_free_req has very difference semantics when called in coroutine context (where it waits) and in non-coroutine context (where it doesn't). Split the two cases to make it clear what is being requested. Cc: qemu-block@nongnu.org Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/nvme.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 01fb28aa63..3e6abef1ce 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -293,34 +293,42 @@ static void nvme_kick(NVMeQueuePair *q) q->need_kick = 0; } -/* Find a free request element if any, otherwise: - * a) if in coroutine context, try to wait for one to become available; - * b) if not in coroutine, return NULL; - */ -static NVMeRequest *nvme_get_free_req(NVMeQueuePair *q) +static NVMeRequest *nvme_get_free_req_nofail_locked(NVMeQueuePair *q) { NVMeRequest *req; - qemu_mutex_lock(&q->lock); - - while (q->free_req_head == -1) { - if (qemu_in_coroutine()) { - trace_nvme_free_req_queue_wait(q->s, q->index); - qemu_co_queue_wait(&q->free_req_queue, &q->lock); - } else { - qemu_mutex_unlock(&q->lock); - return NULL; - } - } - req = &q->reqs[q->free_req_head]; q->free_req_head = req->free_req_next; req->free_req_next = -1; - - qemu_mutex_unlock(&q->lock); return req; } +/* Return a free request element if any, otherwise return NULL. */ +static NVMeRequest *nvme_get_free_req_nowait(NVMeQueuePair *q) +{ + QEMU_LOCK_GUARD(&q->lock); + if (q->free_req_head == -1) { + return NULL; + } + return nvme_get_free_req_nofail_locked(q); +} + +/* + * Wait for a free request to become available if necessary, then + * return it. + */ +static coroutine_fn NVMeRequest *nvme_get_free_req(NVMeQueuePair *q) +{ + QEMU_LOCK_GUARD(&q->lock); + + while (q->free_req_head == -1) { + trace_nvme_free_req_queue_wait(q->s, q->index); + qemu_co_queue_wait(&q->free_req_queue, &q->lock); + } + + return nvme_get_free_req_nofail_locked(q); +} + /* With q->lock */ static void nvme_put_free_req_locked(NVMeQueuePair *q, NVMeRequest *req) { @@ -506,7 +514,7 @@ static int nvme_admin_cmd_sync(BlockDriverState *bs, NvmeCmd *cmd) AioContext *aio_context = bdrv_get_aio_context(bs); NVMeRequest *req; int ret = -EINPROGRESS; - req = nvme_get_free_req(q); + req = nvme_get_free_req_nowait(q); if (!req) { return -EBUSY; } From patchwork Thu Sep 22 08:49:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ODZEF/Nz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8hW2TF2z1yqX for ; Thu, 22 Sep 2022 19:13:15 +1000 (AEST) Received: from localhost ([::1]:39082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIGe-000389-9C for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:13:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtq-0004HM-3J for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtn-00037P-6H for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836572; 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=gEG7sP+TZ893sNXFvklbS5KEErh7APC8OAUbfr5xMK4=; b=ODZEF/NzqHNzj5pmsBkvVNZC/64kHlYgfRqQp02Nemv3JlqBB0pkDgBEhHlWnJfQZFbPXY pZIZoSr55ZF3sfbn8BaRs7f914TSqDtNZO+IKGQ5ItG5d6WAQrcUKSkRMpnABRvD+NI+lI Wpkbn1NBtE6K3XCLKJQIUDuDiKec0DA= 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_128_GCM_SHA256) id us-mta-364-7nHrCHRQOTaXfnP5f83cgw-1; Thu, 22 Sep 2022 04:49:31 -0400 X-MC-Unique: 7nHrCHRQOTaXfnP5f83cgw-1 Received: by mail-ed1-f69.google.com with SMTP id r11-20020a05640251cb00b004516feb8c09so6175970edd.10 for ; Thu, 22 Sep 2022 01:49:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=gEG7sP+TZ893sNXFvklbS5KEErh7APC8OAUbfr5xMK4=; b=iwOLEa2CH+kkITtFAP8fQ474f9k4ioFNZhaHaka7AxFj8Oodsv42pKpQ7EdGKmBNNo 9dY7URW3StPC8QGlM35tsWq8D5Unj2XAGZo9u+KF8ofO3YxSezlk1yxFUV3xMKPv9AtU UQmFhLfcW37L12Nzbu9jRWRiCIbP3g4WuZy0hq30tewhR84n5xGil4ZaBxDFxWUaPnzV erohv65/FlzjE9VQd4QOvj91H2Mlmsf6cB0RVDOo3rbeSoA9uV4101fjbur1FvJLGOnZ +Ak9+5HY49kmEWLG7lRd+aXW0MrD+ppqRp+Jn/A9xgZ5J1N905m5Z/8jqlAztdxpKYet iRSA== X-Gm-Message-State: ACrzQf1WXJfACdzdeH4kMAVCFbJY3xCwdtABkPtCzOmubbrjn8Cqd1wN Cs1KTjucABNrKqH6dBhRvm15RKfH4kr32of26AcXku1Q++Ml/U7C8aLct16MIkZzNQpNixmIxf/ trjYxxZ9pxa/w+ktrqLM8K2oN3iiFXoKScu1+aOYJR0Lby0e1LYWuA+OzwIJ/Mp3w/Kk= X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr2165376ede.116.1663836570034; Thu, 22 Sep 2022 01:49:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HFQ9PbHWqPQLo/qYdLuawfXkVHpXtPhcQK3aHQpDfrbwt1jPnoAKYlDyXZgqh11+YDojHxg== X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr2165355ede.116.1663836569823; Thu, 22 Sep 2022 01:49:29 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id w13-20020a17090652cd00b0073cd7cc2c81sm2307783ejn.181.2022.09.22.01.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 02/26] block: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:00 +0200 Message-Id: <20220922084924.201610-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Paolo Bonzini Reviewed-by: Alberto Faria --- block.c | 6 +++--- block/block-backend.c | 10 +++++----- block/io.c | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/block.c b/block.c index bc85f46eed..5c34ada53f 100644 --- a/block.c +++ b/block.c @@ -631,9 +631,9 @@ static int64_t create_file_fallback_truncate(BlockBackend *blk, * Helper function for bdrv_create_file_fallback(): Zero the first * sector to remove any potentially pre-existing image header. */ -static int create_file_fallback_zero_first_sector(BlockBackend *blk, - int64_t current_size, - Error **errp) +static int coroutine_fn create_file_fallback_zero_first_sector(BlockBackend *blk, + int64_t current_size, + Error **errp) { int64_t bytes_to_clear; int ret; diff --git a/block/block-backend.c b/block/block-backend.c index d4a5df2ac2..aa4adf06ae 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1546,7 +1546,7 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, return &acb->common; } -static void blk_aio_read_entry(void *opaque) +static void coroutine_fn blk_aio_read_entry(void *opaque) { BlkAioEmAIOCB *acb = opaque; BlkRwCo *rwco = &acb->rwco; @@ -1558,7 +1558,7 @@ static void blk_aio_read_entry(void *opaque) blk_aio_complete(acb); } -static void blk_aio_write_entry(void *opaque) +static void coroutine_fn blk_aio_write_entry(void *opaque) { BlkAioEmAIOCB *acb = opaque; BlkRwCo *rwco = &acb->rwco; @@ -1669,7 +1669,7 @@ int coroutine_fn blk_co_ioctl(BlockBackend *blk, unsigned long int req, return ret; } -static void blk_aio_ioctl_entry(void *opaque) +static void coroutine_fn blk_aio_ioctl_entry(void *opaque) { BlkAioEmAIOCB *acb = opaque; BlkRwCo *rwco = &acb->rwco; @@ -1703,7 +1703,7 @@ blk_co_do_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes) return bdrv_co_pdiscard(blk->root, offset, bytes); } -static void blk_aio_pdiscard_entry(void *opaque) +static void coroutine_fn blk_aio_pdiscard_entry(void *opaque) { BlkAioEmAIOCB *acb = opaque; BlkRwCo *rwco = &acb->rwco; @@ -1747,7 +1747,7 @@ static int coroutine_fn blk_co_do_flush(BlockBackend *blk) return bdrv_co_flush(blk_bs(blk)); } -static void blk_aio_flush_entry(void *opaque) +static void coroutine_fn blk_aio_flush_entry(void *opaque) { BlkAioEmAIOCB *acb = opaque; BlkRwCo *rwco = &acb->rwco; diff --git a/block/io.c b/block/io.c index 0a8cbefe86..e3dcb8e7e6 100644 --- a/block/io.c +++ b/block/io.c @@ -751,11 +751,11 @@ static void coroutine_fn tracked_request_end(BdrvTrackedRequest *req) /** * Add an active request to the tracked requests list */ -static void tracked_request_begin(BdrvTrackedRequest *req, - BlockDriverState *bs, - int64_t offset, - int64_t bytes, - enum BdrvTrackedRequestType type) +static void coroutine_fn tracked_request_begin(BdrvTrackedRequest *req, + BlockDriverState *bs, + int64_t offset, + int64_t bytes, + enum BdrvTrackedRequestType type) { bdrv_check_request(offset, bytes, &error_abort); @@ -794,7 +794,7 @@ static bool tracked_request_overlaps(BdrvTrackedRequest *req, } /* Called with self->bs->reqs_lock held */ -static BdrvTrackedRequest * +static coroutine_fn BdrvTrackedRequest * bdrv_find_conflicting_request(BdrvTrackedRequest *self) { BdrvTrackedRequest *req; @@ -1644,10 +1644,10 @@ static bool bdrv_init_padding(BlockDriverState *bs, return true; } -static int bdrv_padding_rmw_read(BdrvChild *child, - BdrvTrackedRequest *req, - BdrvRequestPadding *pad, - bool zero_middle) +static coroutine_fn int bdrv_padding_rmw_read(BdrvChild *child, + BdrvTrackedRequest *req, + BdrvRequestPadding *pad, + bool zero_middle) { QEMUIOVector local_qiov; BlockDriverState *bs = child->bs; @@ -3168,7 +3168,7 @@ out: return ret; } -int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf) +int coroutine_fn bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf) { BlockDriver *drv = bs->drv; CoroutineIOCompletion co = { From patchwork Thu Sep 22 08:49:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ep5EYrjo; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8Ss7291z1yqL for ; Thu, 22 Sep 2022 19:03:09 +1000 (AEST) Received: from localhost ([::1]:39726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obI6t-0005IM-IH for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:03:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtq-0004HL-2q for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtn-00038l-AS for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836574; 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=DiNau0XrV+NcLz+unml0gyWosKKTn8Rulie3wDNrngA=; b=ep5EYrjobqBfh92rCDOcSZDP3k/R0JNzlpucpKnAwVCrIjr34DIzoocBhLwmzWpgotuCQ4 BL0+VKzbKrf0Ipb1XJLDNOTtg5lOqZW/p02JTliWrqKYtfhR47D/Iz/XZAfF2Sfj0JbP9T 7P+Ac5AmggVqj1PCy3hO+YFvIDGY8m4= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-480-W4xPcIiGO5mqwc8aHk_Tyg-1; Thu, 22 Sep 2022 04:49:33 -0400 X-MC-Unique: W4xPcIiGO5mqwc8aHk_Tyg-1 Received: by mail-ej1-f71.google.com with SMTP id hr12-20020a1709073f8c00b0077e8371f847so4240531ejc.20 for ; Thu, 22 Sep 2022 01:49:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=DiNau0XrV+NcLz+unml0gyWosKKTn8Rulie3wDNrngA=; b=gaPgs/XvYFx1aCWgNwwvKMp+XV3Io9GUPaVVr1PamuGe5edXCf8WHiqdke/WULtAd0 Ege7xbV+5slkXID/Nn1KH6j1/nxUSUxhH3FttGHkCNiBMIotnwXPBx8sz30kJ+NjW9dn NR+8tNOw4MpfjQW1cqDGT3A0XUAAbdu6n7eLOQPeePISp4LUsnA+0mFS03Gc7/vYwoJC P9ty7woj8l4IPITx7zmOU/09h8EbtxziNDkEveo6E5okSl2k+/HqisSXDoSxbeqweF4Z 5NYzXDerTaHC36azRMagexMIGKD8DYNdjskhFVeOCW9/JPpDmz1ahH9bcJSdVkrUziaF pQ3w== X-Gm-Message-State: ACrzQf0KRSDpmHpH54CXU+OZGH+8yvybJ0H7x3LmkdyxjLVpm2wU3LEG PDxxv61I31mjIEhbSeOda7dqDO8P7LCy8vk0+LTmk/M2xoFOPSv10OnKTfFMmeR5eUT2I8vhuZI P+E6FOdGKZFTFYY4apt6JMiKfYb2XfdsL6KhKzQxHsarKS+5vIb9IaFaV+aaDq4oVYm8= X-Received: by 2002:a05:6402:114a:b0:454:85e4:2295 with SMTP id g10-20020a056402114a00b0045485e42295mr2179687edw.348.1663836571624; Thu, 22 Sep 2022 01:49:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EAAlxx8Kt98tfB16fv7ZAaiO3BS3SwXCyvoHg/VfM5lTgH0ETcxd8ySdUBAhHYu1EcpxaWQ== X-Received: by 2002:a05:6402:114a:b0:454:85e4:2295 with SMTP id g10-20020a056402114a00b0045485e42295mr2179667edw.348.1663836571404; Thu, 22 Sep 2022 01:49:31 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id 17-20020a170906201100b00731803d4d04sm2289348ejo.82.2022.09.22.01.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 03/26] qcow2: remove incorrect coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:01 +0200 Message-Id: <20220922084924.201610-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is incorrect because qcow2_mark_clean() calls qcow2_flush_caches(). qcow2_mark_clean() is called from non-coroutine context in qcow2_inactivate() and qcow2_amend_options(). Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/qcow2-refcount.c | 4 ++-- block/qcow2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index c4d99817b6..1a6277c783 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1206,7 +1206,7 @@ void qcow2_free_any_cluster(BlockDriverState *bs, uint64_t l2_entry, } } -int coroutine_fn qcow2_write_caches(BlockDriverState *bs) +int qcow2_write_caches(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; int ret; @@ -1226,7 +1226,7 @@ int coroutine_fn qcow2_write_caches(BlockDriverState *bs) return 0; } -int coroutine_fn qcow2_flush_caches(BlockDriverState *bs) +int qcow2_flush_caches(BlockDriverState *bs) { int ret = qcow2_write_caches(bs); if (ret < 0) { diff --git a/block/qcow2.h b/block/qcow2.h index ba436a8d0d..c8d9e8ea79 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -874,8 +874,8 @@ void qcow2_free_any_cluster(BlockDriverState *bs, uint64_t l2_entry, int qcow2_update_snapshot_refcount(BlockDriverState *bs, int64_t l1_table_offset, int l1_size, int addend); -int coroutine_fn qcow2_flush_caches(BlockDriverState *bs); -int coroutine_fn qcow2_write_caches(BlockDriverState *bs); +int qcow2_flush_caches(BlockDriverState *bs); +int qcow2_write_caches(BlockDriverState *bs); int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix); From patchwork Thu Sep 22 08:49:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680980 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ILunKviO; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8L351jLz1yqW for ; Thu, 22 Sep 2022 18:57:15 +1000 (AEST) Received: from localhost ([::1]:40386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obI1A-0001Nz-GH for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 04:57:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtt-0004Ho-LW for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHto-000391-5I for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836575; 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=lGOEj22T6lvWm61okRSFdvQTf9Aoa2AFT1tkZ6fRMl0=; b=ILunKviOm1pAhPU5JUe+Q/dyZQzSoyFHUOsO3M0q8PiqoLGlTEkXlTO0zgQqgfPkKkSKih SL+mLh0Qo8sEPLuXOxPLmPrfeGPNbZwVgK2YnQpIocNNjyebrt7S4T3kdqLIlE9NSwf16C D6wlzzhIICLwm56AZHAsGUg4eULgsWs= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-224-ofAqmCJSPrONCTufrw5JVQ-1; Thu, 22 Sep 2022 04:49:34 -0400 X-MC-Unique: ofAqmCJSPrONCTufrw5JVQ-1 Received: by mail-ej1-f72.google.com with SMTP id sa15-20020a1709076d0f00b00781d793f51fso1346172ejc.18 for ; Thu, 22 Sep 2022 01:49:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=lGOEj22T6lvWm61okRSFdvQTf9Aoa2AFT1tkZ6fRMl0=; b=5gpmETe9B91876eUMsiN/+C/0x/FRoIsmie89VbnAn9oTL2ZPsal2Dd0/x7ivhpHl6 sVSVefsME9NZYmRSf6zqZLXTquxn5CtGTA/6RtovrjLk+SZC7xXYbJSK/vWY6BH3ozIX 8ig4MO/HGTXUb08X6A48DD+rpQfW5Y341ZZB4Hr0qlsV30Raf6K6OjBdrRDeBPczgBa6 9CJU8KIpsOi4T/wOO9dFFGHGNcI9CB0ngA68xvnRq0ce41H/MAvRspy2qNu6m9LEh4nb 1pcYC9KAWgwo0SafMCeS2qgOZyO5po/fgG+y86s1DYGnYitN1TzTSU7TVpU9w+cN+QO4 Q5qA== X-Gm-Message-State: ACrzQf1JDYBUZJiWFDXQu3yhifRpzfovsRUdKi90KTglRmhHOQ0TNsYo oTkmMeC3r6L383oRi9vtAe8Zj15oG1I4TOj4CiIv9zlPHIHkqOkJ5u/gzhGHYc6gzQ9hfifG6Q7 q7nbKzU9JKPUb7S6LU6oLJn4ko9jw5AhDMA633l2NfnE3UuoVj2QO3np3YVixLyQ1PWc= X-Received: by 2002:aa7:dd0a:0:b0:44e:a27b:fec with SMTP id i10-20020aa7dd0a000000b0044ea27b0fecmr2070436edv.168.1663836572822; Thu, 22 Sep 2022 01:49:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5L6p+2CY47nRI4vPJrsO2bzG6WRfm+SJ5oa7k8EMLs/NhtV0pcALoOlbSHmpPKBg/KTD6k7w== X-Received: by 2002:aa7:dd0a:0:b0:44e:a27b:fec with SMTP id i10-20020aa7dd0a000000b0044ea27b0fecmr2070420edv.168.1663836572597; Thu, 22 Sep 2022 01:49:32 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id ky6-20020a170907778600b00778e3e2830esm2384298ejc.9.2022.09.22.01.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 04/26] nbd: remove incorrect coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:02 +0200 Message-Id: <20220922084924.201610-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" nbd_co_establish_connection_cancel() cancels a coroutine but is not called from coroutine context itself, for example in nbd_cancel_in_flight() and in timer callbacks reconnect_delay_timer_cb() and open_timer_cb(). Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- include/block/nbd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index c74b7a9d2e..4ede3b2bd0 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -424,6 +424,6 @@ QIOChannel *coroutine_fn nbd_co_establish_connection(NBDClientConnection *conn, NBDExportInfo *info, bool blocking, Error **errp); -void coroutine_fn nbd_co_establish_connection_cancel(NBDClientConnection *conn); +void nbd_co_establish_connection_cancel(NBDClientConnection *conn); #endif From patchwork Thu Sep 22 08:49:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ad0ZdpwQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8pq0Z3Sz1yqL for ; Thu, 22 Sep 2022 19:18:41 +1000 (AEST) Received: from localhost ([::1]:38332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obILs-0000wE-7p for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:18:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtq-0004He-UM for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtp-00039U-Bi for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836576; 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=aFJ3L77TUFEjwbt4CSDQpeKFnuI2dm866x9il+JnnG4=; b=Ad0ZdpwQwFUMhe/hxzVvhlevviGqMV4KxGpEOJjfDX5FpAfKfZjmS/uzzjJW5lnCA3qG4e qQwE8PXywEBRtx+iXCu806LbVga+IWi5oxN5V2wairk7MpRay9TY3+S2y2ZFrScYyjabA2 Y4i5N+O1mKorhZ8/X+9XSO4MlO5VREA= 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_128_GCM_SHA256) id us-mta-553-keO7TpS-Pvyy6edIEUfAPA-1; Thu, 22 Sep 2022 04:49:35 -0400 X-MC-Unique: keO7TpS-Pvyy6edIEUfAPA-1 Received: by mail-ed1-f72.google.com with SMTP id w20-20020a05640234d400b00450f24c8ca6so6153405edc.13 for ; Thu, 22 Sep 2022 01:49:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=aFJ3L77TUFEjwbt4CSDQpeKFnuI2dm866x9il+JnnG4=; b=CwPifyRrd7Xw1dC5dRGMr6CpFyZkkDGqD2z3T9342mDmt68Fn1WliRdRQWyYvstTo7 DkC2yeHdkTmwWUXCa326PGPb9I4OjLIUL0OVZ0DuEPPb2nSjFW1fTfvQlpQh6fFauOYu 6V6ixOAC2pdSxjM+dulG6EHtcQlFuUmS3f7BJRj1WJxd1s4IE6pHz2x+p62Nxwmg6+wl MC/VHdZSNuj3c+oczcLISD2QKH5SjLDgkXtECAkNPr0VOK8do2EeWxefYMsGDN0RMqok n1mLRFT5p3sV69z/CBdegRF2wu2wsgmxTwKHovOSIdFxhaiU+a/GXVp0jiTcoMYUFQEF 8piw== X-Gm-Message-State: ACrzQf0Vtx3jZpc1MWIkVlM6FnHNIS2Vvup+E3765rGfqAVpGn3qzfd5 1fwJkQxGh/RvpxwoTFWHxhH4j4xOG/mB/lLdzvLoLW2LebOkx96c0/2S8E1aVPxuDphBhPmPYDG 4n6becEk6Ib8aHdDaq9IgMcQpfDNkKymCPuvnkAiexE2lVmKTPj2uTZQUWT0m7Cy1X8g= X-Received: by 2002:a05:6402:2547:b0:450:668c:9d93 with SMTP id l7-20020a056402254700b00450668c9d93mr2208898edb.92.1663836574148; Thu, 22 Sep 2022 01:49:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52fDR1xV3dK4bcx1QCPcgSon0iz4sYkG4s8LPisrLwvUKc3TPAI+cmdzsYYya9YNJRyOojyw== X-Received: by 2002:a05:6402:2547:b0:450:668c:9d93 with SMTP id l7-20020a056402254700b00450668c9d93mr2208868edb.92.1663836573856; Thu, 22 Sep 2022 01:49:33 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id z26-20020a170906945a00b0077016f4c6d4sm2308997ejx.55.2022.09.22.01.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 05/26] coroutine: remove incorrect coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:03 +0200 Message-Id: <20220922084924.201610-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" qemu_coroutine_get_aio_context inspects a coroutine, but it does not have to be called from the coroutine itself (or from any coroutine). Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 2 +- util/qemu-coroutine.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index 08c5bb3c76..e55b36f49a 100644 --- a/include/qemu/coroutine.h +++ b/include/qemu/coroutine.h @@ -92,7 +92,7 @@ void coroutine_fn qemu_coroutine_yield(void); /** * Get the AioContext of the given coroutine */ -AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co); +AioContext *qemu_coroutine_get_aio_context(Coroutine *co); /** * Get the currently executing coroutine diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c index 4a8bd63ef0..356b746f0b 100644 --- a/util/qemu-coroutine.c +++ b/util/qemu-coroutine.c @@ -213,7 +213,7 @@ bool qemu_coroutine_entered(Coroutine *co) return co->caller; } -AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co) +AioContext *qemu_coroutine_get_aio_context(Coroutine *co) { return co->ctx; } From patchwork Thu Sep 22 08:49:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i4VhH76y; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8K14NgVz1yqW for ; Thu, 22 Sep 2022 18:56:21 +1000 (AEST) Received: from localhost ([::1]:58400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obI0J-0007Vh-Fu for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 04:56:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtt-0004Hn-FD for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtr-0003A5-18 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836578; 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=CbIXLc2gbhI5SakGYPZOv4I8pwxGWkpOB2ebhFwo8P0=; b=i4VhH76yoMhUXgbgjlOQNXA1/VB9LQcf8Y97gC8PGh8eMcbERUrhj+6ehPVdaqs4NuEqXe /Onxct02M49IOlx8Nsqtr1o4kYZCHd7NK2EHXHU5e9rxZlK2qisxDjc9eP+QD2Zuo1VXku KQbtKL1wpZvOeHg1rXPzUaZrdqJk5/c= 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_128_GCM_SHA256) id us-mta-301-NVe6_G5HObW5W9_mZHVp7g-1; Thu, 22 Sep 2022 04:49:37 -0400 X-MC-Unique: NVe6_G5HObW5W9_mZHVp7g-1 Received: by mail-ed1-f69.google.com with SMTP id x5-20020a05640226c500b00451ec193793so6219285edd.16 for ; Thu, 22 Sep 2022 01:49:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=CbIXLc2gbhI5SakGYPZOv4I8pwxGWkpOB2ebhFwo8P0=; b=HGJN4CjP+GIGmz1/6uiH5J2z9PiMQTQHvp/o+Vy5fT6oTv/DscMiPPkCclYVkWgzxP 75fJULladVCe90C5ZO8d7l4L5DCXfJRw9Qo6KAUB6WzBoLk1Qz5FGt06RvKa4USyDq8p FyBWhudLFI9GXEBGdkgWWrFLTKBvkQVDc+FeRoJz3iENIdnKVre45tYJAvW1Hfz1g/Oj BQadq43Fw094asoNIQ2fR9JiwS8YUBLFq/Gq9o5C4yTD/9OFVCFU1nSdeLN5MKjqAGPD ocVlh1rDDtx7hQQp7lFwIsjEb/Q8yBQdlrXzTE0baxmdu0K1z5ogj2xkk9NWU0LkiLf0 HUYw== X-Gm-Message-State: ACrzQf0zAFvHyYYb/0QlJju8wobWYrga6TrHHH1jZ8i38FtAcoDke/Ce I9kcHlNLY4/m4nfKC4QLtIAZRN106UEWfxcvrQM+zm5j8WVnZSqpHPwjXC3A45YJu+cOfaRMOv0 /79wHlHe1OvJiMls2MKpYn49yvbuGFuD8aHipMiDo1pPX/LuxCBFoL5Q26pWrZBEhrj8= X-Received: by 2002:a17:906:770d:b0:73c:a08f:593c with SMTP id q13-20020a170906770d00b0073ca08f593cmr1938594ejm.182.1663836575373; Thu, 22 Sep 2022 01:49:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4h65sWl7ToWExHb8IoVZPASibg/h6cFbiQitlPwYuFVQ+Cx2FbOJEZ70LP/REF4+GRoG5Kaw== X-Received: by 2002:a17:906:770d:b0:73c:a08f:593c with SMTP id q13-20020a170906770d00b0073ca08f593cmr1938576ejm.182.1663836575135; Thu, 22 Sep 2022 01:49:35 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id fu32-20020a170907b02000b0073d8ad7feeasm2279775ejc.213.2022.09.22.01.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 06/26] blkdebug: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:04 +0200 Message-Id: <20220922084924.201610-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/blkdebug.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index bbf2948703..a93ba61487 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -587,8 +587,8 @@ out: return ret; } -static int rule_check(BlockDriverState *bs, uint64_t offset, uint64_t bytes, - BlkdebugIOType iotype) +static int coroutine_fn rule_check(BlockDriverState *bs, uint64_t offset, uint64_t bytes, + BlkdebugIOType iotype) { BDRVBlkdebugState *s = bs->opaque; BlkdebugRule *rule = NULL; @@ -672,7 +672,7 @@ blkdebug_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, return bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); } -static int blkdebug_co_flush(BlockDriverState *bs) +static int coroutine_fn blkdebug_co_flush(BlockDriverState *bs) { int err = rule_check(bs, 0, 0, BLKDEBUG_IO_TYPE_FLUSH); @@ -791,7 +791,7 @@ static void blkdebug_close(BlockDriverState *bs) } /* Called with lock held. */ -static void suspend_request(BlockDriverState *bs, BlkdebugRule *rule) +static void coroutine_fn suspend_request(BlockDriverState *bs, BlkdebugRule *rule) { BDRVBlkdebugState *s = bs->opaque; BlkdebugSuspendedReq *r; @@ -810,8 +810,8 @@ static void suspend_request(BlockDriverState *bs, BlkdebugRule *rule) } /* Called with lock held. */ -static void process_rule(BlockDriverState *bs, struct BlkdebugRule *rule, - int *action_count, int *new_state) +static void coroutine_fn process_rule(BlockDriverState *bs, struct BlkdebugRule *rule, + int *action_count, int *new_state) { BDRVBlkdebugState *s = bs->opaque; @@ -840,7 +840,7 @@ static void process_rule(BlockDriverState *bs, struct BlkdebugRule *rule, } } -static void blkdebug_debug_event(BlockDriverState *bs, BlkdebugEvent event) +static void coroutine_fn blkdebug_debug_event(BlockDriverState *bs, BlkdebugEvent event) { BDRVBlkdebugState *s = bs->opaque; struct BlkdebugRule *rule, *next; From patchwork Thu Sep 22 08:49:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DHAvE4cg; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8T64n7Sz1yqL for ; Thu, 22 Sep 2022 19:03:22 +1000 (AEST) Received: from localhost ([::1]:34110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obI76-0005bP-FB for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:03:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtu-0004IT-Ok for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHts-0003AK-Ao for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836579; 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=tJ9IICv8PE6plCAsrPnkp3/CCOC6ITG5IcJpn3oJM/E=; b=DHAvE4cgtyrmkXI8PAMigXqGzIX0EXX7CPwFhP383UhEYU4QwzsgeBJNtV64AoaDFQX2YO LXo85O9jmQOAGFFGWncYUmLP0de7PnMNfzQjptuGsj/dVEE5fui9k+sSKOYp7x1EvDGU2v aMqm1UUVnFy20vAAONPHAY647J7nchU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-397-6PXyyQRYPv2OBXDIENq34g-1; Thu, 22 Sep 2022 04:49:38 -0400 X-MC-Unique: 6PXyyQRYPv2OBXDIENq34g-1 Received: by mail-ej1-f69.google.com with SMTP id dm10-20020a170907948a00b00781fa5e140fso2656999ejc.21 for ; Thu, 22 Sep 2022 01:49:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=tJ9IICv8PE6plCAsrPnkp3/CCOC6ITG5IcJpn3oJM/E=; b=qbdfXu2gn9s+VJxfSKwJ1dMp6Zt99bRGKTj90sXqGPHovZI/DFDXeOzFjQCll5WgBn vMOQFjh5fw4N4jfrDj+VwFMOlGJhTYaZ5ZgEWmi/rkbGI8TDz6syyN4xvt9c96+3NFPv EidVoK19R4wFG/8iAPxo+Mo03LlH7/LA/wyYvmd39kDn/QA+HQtkD/P7LqOmyFNjTj+o oAUZK5KRwkDGz7rDwy1JxvayiVQc4GLotq3m114zp/TpeC6CRFvpwWBdUIonUqfUPVwl OHMQhgIXkTgb7kOBmKB5qkXyyIhy/D+pbAI1XgtE0xFLzqnVO73yJiic4W2w+whDx3HF h8Kw== X-Gm-Message-State: ACrzQf3MxCIZx75Cwf6Zonf3TQ13oEEzhQalujyqdSdJWjn6eU5ILcM1 6bXHTMU5qk45RhkcWjTOgsV7jbpkf56sokreBFFOTRtJQUNIVZkCDU742au3XePJmN0q0RVzUfr FBIPrHdaKhGvcBtkvCunzbA9ebWOKyYKE7683RJLiHpzZd1NJHKEbYeHuzA6jEnsgz70= X-Received: by 2002:a05:6402:11cd:b0:452:199e:7cf6 with SMTP id j13-20020a05640211cd00b00452199e7cf6mr2186472edw.366.1663836577283; Thu, 22 Sep 2022 01:49:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tJwaoiiZeCKt9gmoe65nMnVxorhIIixTHKEmz9v8mImaxmx+2CAcPlaeJ2D1rMQADHfLUew== X-Received: by 2002:a05:6402:11cd:b0:452:199e:7cf6 with SMTP id j13-20020a05640211cd00b00452199e7cf6mr2186451edw.366.1663836577037; Thu, 22 Sep 2022 01:49:37 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id 18-20020a170906309200b0073dc5bb7c32sm2358966ejv.64.2022.09.22.01.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 07/26] blkverify: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:05 +0200 Message-Id: <20220922084924.201610-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/blkverify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blkverify.c b/block/blkverify.c index e4a37af3b2..020b1ae7b6 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -258,7 +258,7 @@ blkverify_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, return blkverify_co_prwv(bs, &r, offset, bytes, qiov, qiov, flags, true); } -static int blkverify_co_flush(BlockDriverState *bs) +static int coroutine_fn blkverify_co_flush(BlockDriverState *bs) { BDRVBlkverifyState *s = bs->opaque; From patchwork Thu Sep 22 08:49:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gcISvu2f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9102V4mz1yqW for ; Thu, 22 Sep 2022 19:27:30 +1000 (AEST) Received: from localhost ([::1]:51014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIUR-0000G5-BW for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:27:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtv-0004Ii-9w for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtt-0003Ad-Pt for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836581; 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=iUtq4WXz65nbgH+uLQQjwF/Lwtao8PfLQHIC0ni20pc=; b=gcISvu2fEXwIVUKFF6zlucI+Xbw6l6nvnJv4Y9EGTyjgirkRsmlsQtrrlCn4JXFjFhdiFr 1j2vdF7rJCzdD+5bXXNTnzAESPcUDDnAuYNgTgJ31C1VsnEmzEXm/fRRDRWYhQP4PPXCZU bMT2WnJRisfdJxSbFJy9Z5f/1AFhY+Y= 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_128_GCM_SHA256) id us-mta-509-q-HjVvYTOw-bDLsxYb50Ow-1; Thu, 22 Sep 2022 04:49:39 -0400 X-MC-Unique: q-HjVvYTOw-bDLsxYb50Ow-1 Received: by mail-ed1-f69.google.com with SMTP id r11-20020a05640251cb00b004516feb8c09so6176195edd.10 for ; Thu, 22 Sep 2022 01:49:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=iUtq4WXz65nbgH+uLQQjwF/Lwtao8PfLQHIC0ni20pc=; b=sw7oy2nrr/S2p8zk3xwpLIPuMIWvwbBEptykTC9/8ApHyd1ulWCfqOMVejJOpjXYec SDHTxei0d4CL7p1CZ6MNTW+MO0foZUNTwOc9tCyraRvwIUAMijY+QxKLXOdGVnz8IGhb raLPj26lB0BrBrgebmJsj+8DI0sdBbRDdy9F+gnR7ySiqZMHN97kgJDD3bzC6MvCpVWW JyvKUtazIpsidP8JHi/6AxzO0sHmkj4q5l7RQ5gSOM50OqmWajlbzz/FPOShe/TF5/EY a7pbBFGZCMALxeA4zobVEd7/uzQGDKXfIarOFy+CpvqRpsnPhSP2jvw5aZw0UkSCQLtj Ay9g== X-Gm-Message-State: ACrzQf3Y8KZFrRNjxfoo0qIMbmheNOj4DE0G5rN1fs5QYM01Qy7ysvZI oIU+IXt0X4FQ96KugFHGDp60kIxOFt9P4Nn9DHLyuGkgUCItZN0rvAK4BgM8P3xY+87Ai8jwTXD fwGfMIyX3+P8wnRwTgG+RtrqIWbIggyb8w/Wo+TAWNMEhaxSQSmkifAdG4HBkNao8weA= X-Received: by 2002:a17:907:6ea7:b0:780:840:f050 with SMTP id sh39-20020a1709076ea700b007800840f050mr1877448ejc.394.1663836578533; Thu, 22 Sep 2022 01:49:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IXV4l8a8lJBFeLOZvRQrDCajLsvtxb85NwPaLWtYSZFVmUNwAMLXGt1P83j6tDvwcBm5ucA== X-Received: by 2002:a17:907:6ea7:b0:780:840:f050 with SMTP id sh39-20020a1709076ea700b007800840f050mr1877435ejc.394.1663836578291; Thu, 22 Sep 2022 01:49:38 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id el8-20020a056402360800b004533fc582cbsm3207817edb.21.2022.09.22.01.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 08/26] file-posix: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:06 +0200 Message-Id: <20220922084924.201610-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 48cd096624..76eea8d350 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2158,7 +2158,7 @@ static void raw_aio_unplug(BlockDriverState *bs) #endif } -static int raw_co_flush_to_disk(BlockDriverState *bs) +static int coroutine_fn raw_co_flush_to_disk(BlockDriverState *bs) { BDRVRawState *s = bs->opaque; RawPosixAIOData acb; From patchwork Thu Sep 22 08:49:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BJBs43f6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8hW2Lhwz1yqW for ; Thu, 22 Sep 2022 19:13:13 +1000 (AEST) Received: from localhost ([::1]:39084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIGc-0003AN-2G for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:13:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHty-0004Le-QJ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtx-0003BY-AC for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836584; 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=gwaSWNYAiuAD3mXFQL3lA7wiv/XLnh3FlGUszdCid5I=; b=BJBs43f6a8GfHbznhrhs/hGf8/3AbMPhXk1Z3rFLZ5QamH+pHRgcSYYH+to44TcQeM6JjU Jq+wZ0UAWvhVnCw9zvgZeEKdvPAhSdsKzrW6yaeoULQXw5fYC7JV+bInzROnVop/2mVcU0 zdoYeptNarVYqxsNXD1JPPZAVddZAco= 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_128_GCM_SHA256) id us-mta-446-OCTLUt1GMuO06UoQrMjhKg-1; Thu, 22 Sep 2022 04:49:41 -0400 X-MC-Unique: OCTLUt1GMuO06UoQrMjhKg-1 Received: by mail-ed1-f69.google.com with SMTP id c6-20020a05640227c600b004521382116dso6287180ede.22 for ; Thu, 22 Sep 2022 01:49:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=gwaSWNYAiuAD3mXFQL3lA7wiv/XLnh3FlGUszdCid5I=; b=vn502nHWwTk977etmNxwJ2TK0XqK67aG5Qju6GY4/f5koyPDjvB12fkX5CdNJ5Qooe Vq7g9qffl9qr7DH+b2q7QHim6vAxMICWympD4kKg1SEWu7hjTXarl0HC1W7zVt4zmBe2 jPM1uWM+xTs4kvXdtfnYQ7gY2CzxNUUSsqKDAucJR4EWI21WPOucu2oLJ7gjr35sCBxF v8aHc2RJPfAxuTkxVG1BBWzAA+ZX0Q5GFMhS2guF+eA7l2/e528lH/qez5dYlARcmQIR HqUALcmaqREBBJUWsDBq1nyjwELpvyvSP+WkkcT5BGerxAtcw5WcUzm9Wc4qd2B7yGTr YKag== X-Gm-Message-State: ACrzQf1eM2U7UOfZJbalGDAsdunLu/Lmgwowbwnlff+YFMP+BXwOiozk MPadQ4ZGJU29GwYPfRAE25tbkW6hjAOezSqOE0Kcme9zsE4UL1glg0JJH+ZZ6QuLNvDIMyHzefD J6z1BbpqiY/FhQ5kkEwydtCv/L5pCCysWNK22XwNS0UonzM1xICDDcrQqclilhxju7Bg= X-Received: by 2002:a05:6402:298e:b0:451:129e:1b35 with SMTP id eq14-20020a056402298e00b00451129e1b35mr2135275edb.79.1663836579847; Thu, 22 Sep 2022 01:49:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4g8Isy2RMVMlaJWwcgzMYmJW0kpeTdbIrhC5RQ36qw1pjXmJSZb5oJr+7Vm36lfLcVqi9ROA== X-Received: by 2002:a05:6402:298e:b0:451:129e:1b35 with SMTP id eq14-20020a056402298e00b00451129e1b35mr2135246edb.79.1663836579578; Thu, 22 Sep 2022 01:49:39 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id kw12-20020a170907770c00b0076ff600bf2csm2357387ejc.63.2022.09.22.01.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 09/26] iscsi: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:07 +0200 Message-Id: <20220922084924.201610-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index d707d0b354..b33eeec794 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -290,7 +290,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status, } } -static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask) +static void coroutine_fn iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask) { *iTask = (struct IscsiTask) { .co = qemu_coroutine_self(), From patchwork Thu Sep 22 08:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=FC143fyc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8qc2Gz4z1yqL for ; Thu, 22 Sep 2022 19:19:24 +1000 (AEST) Received: from localhost ([::1]:37460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIMc-0001qy-6U for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:19:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu6-0004Rq-Iq for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu4-0003De-1S for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836591; 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=y70IF9zLzzuGZH6c3R4J73YdmxCLis2lJBd3y27tBwU=; b=FC143fycPaXgoG/E5kUO6hutiodyaSD4QWSCdlhAQIBbFF0uZ4mby6lPf2HYwfy4XkvxF4 NSwglsj9Og2PeWgw2FF211NXXeH1CiiT8V0YUzU5ohzk17NBvw30xuEyy1yo8877UTMQlk gqZYmzwPbXO42RgXRoJIeii0Qq40K68= 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_128_GCM_SHA256) id us-mta-651-eHjPYJbcMZKXHT1_LS83DQ-1; Thu, 22 Sep 2022 04:49:42 -0400 X-MC-Unique: eHjPYJbcMZKXHT1_LS83DQ-1 Received: by mail-ed1-f69.google.com with SMTP id w17-20020a056402269100b0045249bc17a9so6161657edd.9 for ; Thu, 22 Sep 2022 01:49:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=y70IF9zLzzuGZH6c3R4J73YdmxCLis2lJBd3y27tBwU=; b=jurVEagAL26zxd12FD/9amK4Kq/zLOg9CmmW6E2FMOlXtES+uKBhFiBCM3Tw0kbPfN 8S+zv7Qmx53y55szSpCh+rETbfDWQxpQLDTP9bHp2rawEUhU31qb0DijnZyE/tqaAu5n G+dS0s5hNnUiSQucnyxMC3j9shFkUssV9zpEksAmO29JA6+96x/h7v5bl6LJW+bnAst9 Pa1PDcfIJdZ7/SpX6GRn+DumFnY1mR9ZQSeLEoMzR6N4qrkDtxhDNr0L+K1Qj77rm04s UMRBKK2LTJvaehZLrP6FMpH+RYHMZ+DRRehXuHxzMVpfZUniRqy9OhJQNjdf2R6anOlu XmJw== X-Gm-Message-State: ACrzQf0WL5eh7865XyO7o1a6h42cs7yqsU2XSHQUwUI8kDl9veGPe9gt YMTsg/0Irbe9hk6cvMkWUJ7YnZHxNXRu8kRLSCsrNKfl8uzbFJoJIyE7Ed815idUw72aJQeQ2ae FPeAX9SY26hiTmWh8XkwBcTEvfwQoknIacWU5kKhrkAqMeBJ91zZVIU45Tq8P2RuemYs= X-Received: by 2002:aa7:d054:0:b0:450:f6b9:bc2e with SMTP id n20-20020aa7d054000000b00450f6b9bc2emr2081750edo.413.1663836581433; Thu, 22 Sep 2022 01:49:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4oDkiaTM/8Y7Ykdxo68g/7KEbaW3RG3IVvewCTa+0eAcVz1ZLn/0anMDGjewZQr7GhPP5Ahw== X-Received: by 2002:aa7:d054:0:b0:450:f6b9:bc2e with SMTP id n20-20020aa7d054000000b00450f6b9bc2emr2081732edo.413.1663836581168; Thu, 22 Sep 2022 01:49:41 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id ay21-20020a056402203500b0044e9601e53fsm3244928edb.19.2022.09.22.01.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, Eric Blake Subject: [PATCH 10/26] nbd: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:08 +0200 Message-Id: <20220922084924.201610-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/nbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 97683cce27..786ee79013 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -983,11 +983,11 @@ static void nbd_iter_request_error(NBDReplyChunkIter *iter, int ret) * nbd_reply_chunk_iter_receive * The pointer stored in @payload requires g_free() to free it. */ -static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s, - NBDReplyChunkIter *iter, - uint64_t handle, - QEMUIOVector *qiov, NBDReply *reply, - void **payload) +static bool coroutine_fn nbd_reply_chunk_iter_receive(BDRVNBDState *s, + NBDReplyChunkIter *iter, + uint64_t handle, + QEMUIOVector *qiov, NBDReply *reply, + void **payload) { int ret, request_ret; NBDReply local_reply; From patchwork Thu Sep 22 08:49:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g73EZTIN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8hh6ht2z1yqW for ; Thu, 22 Sep 2022 19:13:24 +1000 (AEST) Received: from localhost ([::1]:40990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIGn-0003Vc-TX for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:13:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtz-0004MM-SX for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHty-0003Bh-1H for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836585; 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=W3MW9mE1BsL5Mv0gGMFT3yEiQ6jzCGv4PL3FWaPSfgc=; b=g73EZTINMp1CeoYWkiO6rn6WwkBvWrIhMs1CikNsDVRNVpWuE2EUpR3wKJrekPD54jjlQS 9TwuN3l6RIKEvnv3WylO3I3JzGaUQebgN/rH1TOgNLVLLZuxjGiJaIOiH/He+hTAlodB60 frJbwP3ID532FbA5pEe7EXfgj/nz6JY= 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_128_GCM_SHA256) id us-mta-661-SJQnTElhMRK9OYElqSJZyA-1; Thu, 22 Sep 2022 04:49:44 -0400 X-MC-Unique: SJQnTElhMRK9OYElqSJZyA-1 Received: by mail-ed1-f70.google.com with SMTP id w17-20020a056402269100b0045249bc17a9so6161709edd.9 for ; Thu, 22 Sep 2022 01:49:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=W3MW9mE1BsL5Mv0gGMFT3yEiQ6jzCGv4PL3FWaPSfgc=; b=g+7Y8pfVAKoQ1UDgcN78VBcI8pWYSMqAT+LCn7Wc2F4jlEeZ0WiIU03A+6Sb6mCJjd 8F3pqfMvlUYVBkc78y48VVYY+cs8y7WmuqxHXciUz6ICtGjeSfJq0QifotHRhUZ4Q33U icacpfWm+nqYey6GMVjm0bVLHnxi2SDEr5uedpbBzkInMFKZiP2KMpH01BHBMix1dT2i C/VTEj83zjhJn1cruEgodOKLK/gtAz0OzJFQgq813RG6UbGkdN6P9Wm0QNQ/EQDvXWcT 1kDGX7HaH53POW2gAhjUEvPzX+3NVzOIdL9jU/5Sv3c4GVmCTg1ZgBl++8C6Thda3i1w EJXw== X-Gm-Message-State: ACrzQf3J08nKFc6N+zbqQ9Vr7MnUco6CNpLfxaZrWhTCjWzWOXuDVVo+ 197FEpm4sI/64+b8LmS6OyMdRgSK2CrVdactNd9wrzOXFmIiuQOeGPGhcwKFq8vk0GnJqsz+Ga8 OVYFSWRMcOAN/RxHWZajmjBcRxeHwqYNuoX4of0vTsbnnpr0ep1gHHdcBFZw3/1762BQ= X-Received: by 2002:a17:907:5c5:b0:77d:ea1:44c with SMTP id wg5-20020a17090705c500b0077d0ea1044cmr1841987ejb.305.1663836582982; Thu, 22 Sep 2022 01:49:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DgKX8CxTLbRutSjzj29qCiCti05pgQ74vQokN5is5cNGoB9K7wDFDnXOQzRRyWJvN15F+bQ== X-Received: by 2002:a17:907:5c5:b0:77d:ea1:44c with SMTP id wg5-20020a17090705c500b0077d0ea1044cmr1841974ejb.305.1663836582700; Thu, 22 Sep 2022 01:49:42 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id jt2-20020a170906dfc200b007417041fb2bsm2296185ejc.116.2022.09.22.01.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 11/26] nfs: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:09 +0200 Message-Id: <20220922084924.201610-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nfs.c b/block/nfs.c index 444c40b458..596ebe98cb 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -223,7 +223,7 @@ static void nfs_process_write(void *arg) qemu_mutex_unlock(&client->mutex); } -static void nfs_co_init_task(BlockDriverState *bs, NFSRPC *task) +static void coroutine_fn nfs_co_init_task(BlockDriverState *bs, NFSRPC *task) { *task = (NFSRPC) { .co = qemu_coroutine_self(), From patchwork Thu Sep 22 08:49:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=P6w1vGzi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8YG4Kb2z1ypf for ; Thu, 22 Sep 2022 19:06:57 +1000 (AEST) Received: from localhost ([::1]:35140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIAX-0007UR-KX for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:06:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu1-0004MU-5x for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHtz-0003CM-Lv for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836587; 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=sAFAs4hAiiPiiYyIOLDT0XHpVnfH9R+UM/N5QubwJIk=; b=P6w1vGziEdPGUXI8SgV73eruaeqeUyzghi44P4quY672/PdvuIoVkZ/CUXHkbzcoW/9D+b BYHk9R1KfsOPjdNHBbtTOQYOZXfIPSNPADtbLuCUXcvazGmLfHPlD94ooBnjzG0NCdM/Qy Y4Sm7Z8tXUea/szRq3jtU0dPJJpnP4E= 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_128_GCM_SHA256) id us-mta-67-iHre37S8PaCZVxm9QYk-4A-1; Thu, 22 Sep 2022 04:49:45 -0400 X-MC-Unique: iHre37S8PaCZVxm9QYk-4A-1 Received: by mail-ed1-f69.google.com with SMTP id w20-20020a05640234d400b00450f24c8ca6so6153724edc.13 for ; Thu, 22 Sep 2022 01:49:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=sAFAs4hAiiPiiYyIOLDT0XHpVnfH9R+UM/N5QubwJIk=; b=6w1Ejg/rsV8+hLNdy5444FyvAol7IqfjgFGGtDvi7rEpXbdarrEwK85sycIkuvtN0B s++0x/jqACKCvzfXXtaTGIkIOW3nXI4EltzErgpbNa6iJWXpK/9G7KG/Mr2Xqpq5JwxK nbBJb0BTYLpDgsaBJdB4wpJ3MQx/7zpkUhFdY4pHv2ZP/A6tPCOokEYnNxBAlZjfdtJK v5CtjUStNYD+VRb9wMCxtHikm4kqP5u8bzfjRX6dv7P115xkgBIzbTBphLktHOtz+All 3FnKflXoQM6XOV+7S4Q0J1CBbXpx5pBnO5U4NjY4SaM6+GX7ipMzXJUuVFdpGR0PiqTn uOUA== X-Gm-Message-State: ACrzQf3/m4KmSesDd7mi8G2UtEq4lBHYiNpEZEGRccNqcr9seHN35Dul jNHrlu0GmgCbxtf4D4SlQd39V8nlfolP7t9y/t6j6mWlKWQAMijlz6F0x0el1P1SMCBmj5ails/ gCs0XG33H5CuSYnukh/6DgwndPeIpJRh3Dr8b2jESti89XtFUq8i76/zwzwWvMy+XoJk= X-Received: by 2002:a17:907:62a1:b0:781:b320:90c0 with SMTP id nd33-20020a17090762a100b00781b32090c0mr1759344ejc.255.1663836584252; Thu, 22 Sep 2022 01:49:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ghzK16tMiaf1ZWvoOA5nAvB3y+8sLo34wX1L9Dla1Qa/ejWwfYALLYp3FeGgVsTsHasgzJw== X-Received: by 2002:a17:907:62a1:b0:781:b320:90c0 with SMTP id nd33-20020a17090762a100b00781b32090c0mr1759321ejc.255.1663836584001; Thu, 22 Sep 2022 01:49:44 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id el8-20020a056402360800b004533fc582cbsm3207944edb.21.2022.09.22.01.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 12/26] nvme: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:10 +0200 Message-Id: <20220922084924.201610-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/nvme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 3e6abef1ce..c51b9f5cd3 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1242,8 +1242,9 @@ static inline bool nvme_qiov_aligned(BlockDriverState *bs, return true; } -static int nvme_co_prw(BlockDriverState *bs, uint64_t offset, uint64_t bytes, - QEMUIOVector *qiov, bool is_write, int flags) +static coroutine_fn int nvme_co_prw(BlockDriverState *bs, + uint64_t offset, uint64_t bytes, + QEMUIOVector *qiov, bool is_write, int flags) { BDRVNVMeState *s = bs->opaque; int r; From patchwork Thu Sep 22 08:49:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CDusB1wY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY97J1QSBz1yqL for ; Thu, 22 Sep 2022 19:33:00 +1000 (AEST) Received: from localhost ([::1]:48484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIZl-00069v-Am for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:32:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu2-0004Mp-CK for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu0-0003Cf-OC for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836588; 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=FoMhUiiW46hHU/7ueBXGLOXJdUNOszC/FunOU7fBMmo=; b=CDusB1wYf8FXUK6MUnpnNTZgEj+aF6COFTG1oS4UIHmhLYKJ7bgB5rcpqzwqetVIbJTs76 i+eIs4wGS6oCjKd2X4PG/FQhfGf3q+zE0je8lPBHuLIMW4+ov4UDdUwmivmCEKbDzg/OA4 eS8vEYJ4tI6x1YHaZWLOlWZMzvFE070= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-178-McvT4AwOMCesX4CRIT95Qg-1; Thu, 22 Sep 2022 04:49:47 -0400 X-MC-Unique: McvT4AwOMCesX4CRIT95Qg-1 Received: by mail-ej1-f69.google.com with SMTP id dt13-20020a170907728d00b007825956d979so427700ejc.15 for ; Thu, 22 Sep 2022 01:49:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=FoMhUiiW46hHU/7ueBXGLOXJdUNOszC/FunOU7fBMmo=; b=lkvopf1yJ/rjceUAybjp8XytOC/lwSukSmubvVB3lBhPH43rLrc9XW3F+UeZr6paCi MXepbq87JQg4cfNJbjVpMlWUq0Bkf0kxFvGfX0zWSsumV0Eixfg61CnlqE9cDbyGlanw bTP1trQjdYJZJgVEHo51+Nc+kxmNIRZ60NhikNfO7XB4yf4igkvXWcyfyAhPT+VQfey6 dIe+v0bEUpLMjp9q/LQpIAQFi7OkJ+DjHKUkR7tTJ5z06ppXznjpUbuDf4lxc80/4uZg oRBVdKhLcStHPSY9JiQlHBZXWG8eYk6ej4d7kl83CBiEXntbKxXA/gy7MGO8O5ZY5918 9QXw== X-Gm-Message-State: ACrzQf3pN+VSAMpehaFnHLF4yqxAGJdAa6TP5SmxH8PmJqXmDl5OZ0aF dyK9acMRDgGBXXp87dGLAx9j9mmGjMDoIHpqgnfp+mfh/DpVLbKo4er3QJVb1z7v+xCV0BT1G1E Ch78OifHqer0J1zasATEny8RjrpY6W/YjBLW0oMuKjcMmZFC2IjAXtSMPI57hU3t1s6U= X-Received: by 2002:a17:906:db03:b0:741:337e:3600 with SMTP id xj3-20020a170906db0300b00741337e3600mr1870129ejb.343.1663836585590; Thu, 22 Sep 2022 01:49:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jEiBJbBamSXVIERtfq8mlZ9To10j3RTH3DnM4Otq8FUiHiazXBTY4j/Yu0s2i7h2BGc2r9A== X-Received: by 2002:a17:906:db03:b0:741:337e:3600 with SMTP id xj3-20020a170906db0300b00741337e3600mr1870110ejb.343.1663836585306; Thu, 22 Sep 2022 01:49:45 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id n26-20020aa7c45a000000b00452ff2c203asm3277956edr.92.2022.09.22.01.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 13/26] parallels: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:11 +0200 Message-Id: <20220922084924.201610-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/parallels.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index a229c06f25..5fc726f446 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -165,8 +165,9 @@ static int64_t block_status(BDRVParallelsState *s, int64_t sector_num, return start_off; } -static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num, - int nb_sectors, int *pnum) +static coroutine_fn int64_t allocate_clusters(BlockDriverState *bs, + int64_t sector_num, + int nb_sectors, int *pnum) { int ret = 0; BDRVParallelsState *s = bs->opaque; From patchwork Thu Sep 22 08:49:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JrQ6P6dX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9Kc5JXsz1yqL for ; Thu, 22 Sep 2022 19:41:56 +1000 (AEST) Received: from localhost ([::1]:44924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIiQ-0004fb-KS for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu6-0004SB-UZ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu5-0003Dx-4C for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836592; 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=z170oJoKSKZDpg7rTxvcQkX8GrHO+LozmHjN9GFYeEU=; b=JrQ6P6dXE9GSwMMNstnwADglOhCXq+GjuCbCTlDLENxb2+dKSJMQlKbkEYgoqSiCKxGCse 16/U60PSLfQcxB7Mz4Vv8OCTA1AJlSEmikVlAnuBUfbaC98WdcBEYWBXNhXprmdocqLktR LYVFtAEZGBeBosaTHDMfVRYvIvKgfG0= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-110-R3QSiDPBPTCDKl4zTfvCMQ-1; Thu, 22 Sep 2022 04:49:48 -0400 X-MC-Unique: R3QSiDPBPTCDKl4zTfvCMQ-1 Received: by mail-ej1-f70.google.com with SMTP id qb30-20020a1709077e9e00b0077d1271283eso4142890ejc.2 for ; Thu, 22 Sep 2022 01:49:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=z170oJoKSKZDpg7rTxvcQkX8GrHO+LozmHjN9GFYeEU=; b=wWWR/EXgeW5T6rs8qq/XCd+rIqmXvR4MNOZERue99SSaRX8ksU23SrMZ3fBDeacg6U 2fmHQ3NpuQH//QWNuUms7RfAB+AHG/p4ZJnxbJ1bHq1eJ8pyFsA/bYyDDhgR5pHa3kvX VaVWVtt7V/FDEFiNgKJ2nFEQy0s0r9XkFL3LicBjAzpfHU/WSqbYtSqT6VO1mUtaknro 0AX0qi4NMS3gdVrOgBdvB4+6OOG1W3MFoNl7YDjsZYmOVnwOyMrDySqRt3TOc/T6bAQW UxZ2Onqfgopb9EzY0DW5eehXQWggQZTpAkC4iZoS7Xtog1rX+4TucT7x5uHD2t2VLWlI g9ow== X-Gm-Message-State: ACrzQf2S2iJ5c63fKkenSQQOxg+fey7g1oxeMrC5wUNxnCBLR30BpS// eZGgAvWnPQDkXFgQuMx8AQRfz+ZQzParoLZ26kTCcwf3T4eVyauagcm+mq5wgnPzYAwuOsV0qh0 34DnC0K2lxPOHka2MQtQGjl6AgOb7qcMToAA0OFak2Ruc+fx8+PWBLfFlenxv3Q+nqig= X-Received: by 2002:aa7:c849:0:b0:453:9543:6ef3 with SMTP id g9-20020aa7c849000000b0045395436ef3mr2165288edt.105.1663836586920; Thu, 22 Sep 2022 01:49:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ano8/YtlsfI/MjgIvxdBNgYwYzmOYSuluImiPTRUp44OOmcj+0J+r7iDuczBZS5o+5s1tlg== X-Received: by 2002:aa7:c849:0:b0:453:9543:6ef3 with SMTP id g9-20020aa7c849000000b0045395436ef3mr2165260edt.105.1663836586644; Thu, 22 Sep 2022 01:49:46 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id b21-20020a17090630d500b0071cef6c53aesm2356943ejb.0.2022.09.22.01.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 14/26] qcow2: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:12 +0200 Message-Id: <20220922084924.201610-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/qcow2-cluster.c | 18 +++++++++--------- block/qcow2-refcount.c | 2 +- block/qcow2.c | 4 ++-- block/qcow2.h | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index fd32316d6f..f6a12ed510 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -884,7 +884,7 @@ int qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, return 0; } -static int perform_cow(BlockDriverState *bs, QCowL2Meta *m) +static int coroutine_fn perform_cow(BlockDriverState *bs, QCowL2Meta *m) { BDRVQcow2State *s = bs->opaque; Qcow2COWRegion *start = &m->cow_start; @@ -1024,7 +1024,7 @@ fail: return ret; } -int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) +int coroutine_fn qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) { BDRVQcow2State *s = bs->opaque; int i, j = 0, l2_index, ret; @@ -1397,8 +1397,8 @@ static int count_single_write_clusters(BlockDriverState *bs, int nb_clusters, * information on cluster allocation may be invalid now. The caller * must start over anyway, so consider *cur_bytes undefined. */ -static int handle_dependencies(BlockDriverState *bs, uint64_t guest_offset, - uint64_t *cur_bytes, QCowL2Meta **m) +static int coroutine_fn handle_dependencies(BlockDriverState *bs, uint64_t guest_offset, + uint64_t *cur_bytes, QCowL2Meta **m) { BDRVQcow2State *s = bs->opaque; QCowL2Meta *old_alloc; @@ -1772,9 +1772,9 @@ out: * * Return 0 on success and -errno in error cases */ -int qcow2_alloc_host_offset(BlockDriverState *bs, uint64_t offset, - unsigned int *bytes, uint64_t *host_offset, - QCowL2Meta **m) +int coroutine_fn qcow2_alloc_host_offset(BlockDriverState *bs, uint64_t offset, + unsigned int *bytes, uint64_t *host_offset, + QCowL2Meta **m) { BDRVQcow2State *s = bs->opaque; uint64_t start, remaining; @@ -2105,8 +2105,8 @@ out: return ret; } -int qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, int flags) +int coroutine_fn qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset, + uint64_t bytes, int flags) { BDRVQcow2State *s = bs->opaque; uint64_t end_offset = offset + bytes; diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 1a6277c783..1fbb07ca77 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -3706,7 +3706,7 @@ int64_t qcow2_get_last_cluster(BlockDriverState *bs, int64_t size) return -EIO; } -int qcow2_detect_metadata_preallocation(BlockDriverState *bs) +int coroutine_fn qcow2_detect_metadata_preallocation(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; int64_t i, end_cluster, cluster_count = 0, threshold; diff --git a/block/qcow2.c b/block/qcow2.c index c6c6692fb7..b4d04e91fa 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2436,7 +2436,7 @@ static bool merge_cow(uint64_t offset, unsigned bytes, * Return 1 if the COW regions read as zeroes, 0 if not, < 0 on error. * Note that returning 0 does not guarantee non-zero data. */ -static int is_zero_cow(BlockDriverState *bs, QCowL2Meta *m) +static int coroutine_fn is_zero_cow(BlockDriverState *bs, QCowL2Meta *m) { /* * This check is designed for optimization shortcut so it must be @@ -2454,7 +2454,7 @@ static int is_zero_cow(BlockDriverState *bs, QCowL2Meta *m) m->cow_end.nb_bytes); } -static int handle_alloc_space(BlockDriverState *bs, QCowL2Meta *l2meta) +static int coroutine_fn handle_alloc_space(BlockDriverState *bs, QCowL2Meta *l2meta) { BDRVQcow2State *s = bs->opaque; QCowL2Meta *m; diff --git a/block/qcow2.h b/block/qcow2.h index c8d9e8ea79..36495d9051 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -895,7 +895,7 @@ int qcow2_change_refcount_order(BlockDriverState *bs, int refcount_order, void *cb_opaque, Error **errp); int qcow2_shrink_reftable(BlockDriverState *bs); int64_t qcow2_get_last_cluster(BlockDriverState *bs, int64_t size); -int qcow2_detect_metadata_preallocation(BlockDriverState *bs); +int coroutine_fn qcow2_detect_metadata_preallocation(BlockDriverState *bs); /* qcow2-cluster.c functions */ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size, @@ -908,9 +908,9 @@ int qcow2_encrypt_sectors(BDRVQcow2State *s, int64_t sector_num, int qcow2_get_host_offset(BlockDriverState *bs, uint64_t offset, unsigned int *bytes, uint64_t *host_offset, QCow2SubclusterType *subcluster_type); -int qcow2_alloc_host_offset(BlockDriverState *bs, uint64_t offset, - unsigned int *bytes, uint64_t *host_offset, - QCowL2Meta **m); +int coroutine_fn qcow2_alloc_host_offset(BlockDriverState *bs, uint64_t offset, + unsigned int *bytes, uint64_t *host_offset, + QCowL2Meta **m); int qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, uint64_t offset, int compressed_size, @@ -918,13 +918,13 @@ int qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, void qcow2_parse_compressed_l2_entry(BlockDriverState *bs, uint64_t l2_entry, uint64_t *coffset, int *csize); -int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m); +int coroutine_fn qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m); void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m); int qcow2_cluster_discard(BlockDriverState *bs, uint64_t offset, uint64_t bytes, enum qcow2_discard_type type, bool full_discard); -int qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, int flags); +int coroutine_fn qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset, + uint64_t bytes, int flags); int qcow2_expand_zero_clusters(BlockDriverState *bs, BlockDriverAmendStatusCB *status_cb, From patchwork Thu Sep 22 08:49:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Wc3nJKyU; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8pt191qz1yqL for ; Thu, 22 Sep 2022 19:18:46 +1000 (AEST) Received: from localhost ([::1]:39076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obILz-00019t-9l for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:18:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu6-0004RU-B8 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu3-0003DQ-LQ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836590; 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=UzS2L37BHSdIkyL6Vc6S10N2Cgc3pQRU3RHr2iDDn0Y=; b=Wc3nJKyUKaYBYbHfGq8zRDrjs7x+a9UxCkY7z/o1KcUrEVrbfxAblCTb2DH8gESDwWEbh5 o7Dp2OnoqrNi8ryb/2k6JlFcac6rnRvjrT6zLyr9GW46MF3WsZ9xjDYAEfus7U9O4K5/zO xAvhFhawcdF1Jj0IBnn3bW0p0nKF15w= 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_128_GCM_SHA256) id us-mta-381-Q_Sa2p4OPGy435tZbPdGCw-1; Thu, 22 Sep 2022 04:49:49 -0400 X-MC-Unique: Q_Sa2p4OPGy435tZbPdGCw-1 Received: by mail-ed1-f69.google.com with SMTP id b16-20020a056402279000b0044f1102e6e2so6318953ede.20 for ; Thu, 22 Sep 2022 01:49:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=UzS2L37BHSdIkyL6Vc6S10N2Cgc3pQRU3RHr2iDDn0Y=; b=GXBFoA9mbk10tTUktdNZBjBSdsHHD4heyuy8sVL3uf4aJNRhyxGV19OZsNOpHmh0qv dIeRxaytdTPGO2QUVgC0AP/wwo3snC1q1CpVCNnuMCJqsxANqBD1efyqTvPfaJxtTuyD D2JQMI4vJEBLiGgkcVFakFR3XgTWlWZuHjLWBimtmxEExEGby3C6DJ+2M4kHtc9Y5A/h A0dUyhr29i51K5PdyuVHfAbxFENl+KrXLpn1WXz9zIP3j5+I/O81uz/61OMLmLwd44QV 7bgviWQygN86R3HVDxlshbCVVwaxq1FF7cRBNY+9vdU6WW/I0ieHUYlUnY6GeyeE2KSF PJxQ== X-Gm-Message-State: ACrzQf3uVfXZmxvkU8HhKahwO/PxDF1rOVA+GIZkZtGh6xGaLzo2mlcE piU6brwjsBJriEFtoFTizrG7TtWWgW+pwwXuMJa7iUE7GQknmqAZQVxDP92oN0J+W5YccAcbiEM BhilnQ2gA2uLXtH88jnzCei5q+2y3FMlSLJ3sdjaX1b3e5yZFKIpiNgSRhkNEnYfqk5I= X-Received: by 2002:a17:906:8a7b:b0:781:8016:2de1 with SMTP id hy27-20020a1709068a7b00b0078180162de1mr1871120ejc.54.1663836588528; Thu, 22 Sep 2022 01:49:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4sOWsV1VNzOM8Hh1YyXR0Xl6Ux2ORyugyl8PQW0TmHa8BR2w6VrsNgI+nOYgbIBHRvp18wtQ== X-Received: by 2002:a17:906:8a7b:b0:781:8016:2de1 with SMTP id hy27-20020a1709068a7b00b0078180162de1mr1871099ejc.54.1663836588279; Thu, 22 Sep 2022 01:49:48 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id i23-20020a50d757000000b004479cec6496sm3315629edj.75.2022.09.22.01.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 15/26] copy-before-write: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:13 +0200 Message-Id: <20220922084924.201610-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/copy-before-write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index c24b8dd117..14af7eb753 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -203,9 +203,9 @@ static int coroutine_fn cbw_co_flush(BlockDriverState *bs) * It's guaranteed that guest writes will not interact in the region until * cbw_snapshot_read_unlock() called. */ -static BlockReq *cbw_snapshot_read_lock(BlockDriverState *bs, - int64_t offset, int64_t bytes, - int64_t *pnum, BdrvChild **file) +static coroutine_fn BlockReq *cbw_snapshot_read_lock(BlockDriverState *bs, + int64_t offset, int64_t bytes, + int64_t *pnum, BdrvChild **file) { BDRVCopyBeforeWriteState *s = bs->opaque; BlockReq *req = g_new(BlockReq, 1); @@ -240,7 +240,7 @@ static BlockReq *cbw_snapshot_read_lock(BlockDriverState *bs, return req; } -static void cbw_snapshot_read_unlock(BlockDriverState *bs, BlockReq *req) +static coroutine_fn void cbw_snapshot_read_unlock(BlockDriverState *bs, BlockReq *req) { BDRVCopyBeforeWriteState *s = bs->opaque; From patchwork Thu Sep 22 08:49:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LxDcNyuX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY91W6k01z1yqW for ; Thu, 22 Sep 2022 19:27:59 +1000 (AEST) Received: from localhost ([::1]:44768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIUu-0000Pt-KA for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:27:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu7-0004SH-LQ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu6-0003EG-0T for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836593; 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=O6AXzgGtdYWeMtnt6YWtXqyOu/JX+5LJAyvz2m6ZVtw=; b=LxDcNyuXQysMie9xV+2JLP76FKRUd6HR5oCgdTPId/kGQQAbcj6FJHujW0BvQxSeJmeQRy LIEcg/QY6b7hb/IZ0s2tOZK2DAsTJO18Pppty2OqDZack0Ko4hhUHXUT/K1uCkVR4VeLRF Jk0RyJzvhEr9DsHvVU/9RrjCzM218/0= 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_128_GCM_SHA256) id us-mta-486-rNUxlVKuMEaSRs2x9TugKg-1; Thu, 22 Sep 2022 04:49:51 -0400 X-MC-Unique: rNUxlVKuMEaSRs2x9TugKg-1 Received: by mail-ed1-f70.google.com with SMTP id z2-20020a056402274200b004516734e755so6178010edd.3 for ; Thu, 22 Sep 2022 01:49:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=O6AXzgGtdYWeMtnt6YWtXqyOu/JX+5LJAyvz2m6ZVtw=; b=Px6a/dLy0prCASTvrIL1DHoDJq5R1L0ScATvb4TP45nCxzRkRogTrRiB0BlbxlV5jD p0cRNGKlgcE/MLuUnx3VS4JEn+2CzKBjNQ1wJP+iaaPjgsvgFFd4PEatiGc06hXQu/tm qNz0/+QvDkL21Mm9QRcMxMIvoB4XGH/wuzyyhe31h3OX5klJLWMN2BRemOkfAHlFlH6K qEKDqMVTJniG42Imk9ELkImJ2sWfdKncG77ZuhNr6C3X6wO2K4y3FBfvRdWy9ok5sxr2 XxJI0Og/YlbOYfzwk1uBm4e5I//8ofbVcJZZ9716T1QLrKMXYxyPQySKsGR7qKBvjQBd ierw== X-Gm-Message-State: ACrzQf1nnpdU6pOJQYOHCcpVXuW74+ASG3ZPa18I2H/VRpd04AGhowQP pJSRa1p+FC+NpowY1uqXCSWYqabDR5n9XLvRcgCiHjAxa+QyeKjpjDfbmJvBoykp68UxTLhhwHO vDTu4ykbgDZuchkzgTi7GUb+aQYMjfUtR2CemdSXuV6zVwq1iCf7UeeSFF+ew+ki5YLY= X-Received: by 2002:a05:6402:43cf:b0:450:eae1:c9d3 with SMTP id p15-20020a05640243cf00b00450eae1c9d3mr2139622edc.231.1663836589795; Thu, 22 Sep 2022 01:49:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IioacpwDCdEDsGN/kdg8wnRbBXkbewG88bBcyTM/XG1KymnBHH9CIPEVdYOW+dC8QyUgGcQ== X-Received: by 2002:a05:6402:43cf:b0:450:eae1:c9d3 with SMTP id p15-20020a05640243cf00b00450eae1c9d3mr2139601edc.231.1663836589479; Thu, 22 Sep 2022 01:49:49 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id kv6-20020a17090778c600b0076f0ab594e9sm2323852ejc.73.2022.09.22.01.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 16/26] curl: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:14 +0200 Message-Id: <20220922084924.201610-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index 1e0f609579..cba4c4cac7 100644 --- a/block/curl.c +++ b/block/curl.c @@ -855,7 +855,7 @@ out_noclean: return -EINVAL; } -static void curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) +static void coroutine_fn curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) { CURLState *state; int running; From patchwork Thu Sep 22 08:49:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jGGkSMNv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9NX6LbGz1yqL for ; Thu, 22 Sep 2022 19:44:28 +1000 (AEST) Received: from localhost ([::1]:60024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIks-0006M5-MT for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:44:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuO-0004YL-6f for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuL-0003TA-At for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836608; 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=lGlB7wDGTDXEUeXT2vUgCzKB9NN/3MUucWZTD+WyvLA=; b=jGGkSMNv7SdSECyYWDriuVCzZpTO/DoLKqhibpLBa5x8hzzKXhTRY7E6ZocF5R+VwYPLoT EwubIc6c5fk7BQqBdUw+j5yLqrokcUQV2Arrx4FNcoZIf1Y13gHtSZcfrvj910SI7KFCW0 jHK9xvm+wZEOCTt/TpZTC7tGqONNhtw= 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_128_GCM_SHA256) id us-mta-507-7Bg3s1vrNcezx5rCgw-Hqg-1; Thu, 22 Sep 2022 04:49:52 -0400 X-MC-Unique: 7Bg3s1vrNcezx5rCgw-Hqg-1 Received: by mail-ed1-f70.google.com with SMTP id y14-20020a056402440e00b0044301c7ccd9so6160734eda.19 for ; Thu, 22 Sep 2022 01:49:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=lGlB7wDGTDXEUeXT2vUgCzKB9NN/3MUucWZTD+WyvLA=; b=ihAPMqr5vy7/BhCxvLI2fbLEhnmwwUUtlnoQKqfAFznzmNvdUwaP6Brap6vdvTcYK7 2PtNIRNBNu9CmhG023J3EO/aP/BSCF7lyowKRWkpkoRRFm04U8tLffdF8kV5X5SmzELy MIIPzx8ENoaPg7EozlzfA/WwuCSurULIE6799IMtXboPexnItrwWTefbEmDR0MFOireH 3xBm3XT/8AHVlqS8i2wQzRecCs7E06x/KIcOzxAurCTz07Nrx6yofprLYpL34bqel7tK mvPMzJAglMYo2KcmVZNr7ad4UbKXSjafusS3ujEGbRALdZodUhna3pv92ts9m6irHhYa wueQ== X-Gm-Message-State: ACrzQf20bfkQwdu5G1ZAGFq60bivYoEUKSPEP3ypHS5jFO2RSXFj17+a DpdIBsS3XoB7d3XFezKyEDmycCqJm1k43gsrEcjmd0XhNNatfX7YFxDtEptKmDpdlxMQlQlcdT5 q4XBtEMDVCDlOvteItton9d/kMfWHZcG/QVfFSGXPSH5a4Cg9DLvXcSp2ngTgRWeB6zs= X-Received: by 2002:a17:907:d04:b0:76e:e208:27ba with SMTP id gn4-20020a1709070d0400b0076ee20827bamr1937104ejc.652.1663836591266; Thu, 22 Sep 2022 01:49:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4h+m5PCvGdNKBDVw9bBVGOFaUS51QGheBCvbV9LwgYi3/NLEdnODhQRGgD989LQHQ6K5toCg== X-Received: by 2002:a17:907:d04:b0:76e:e208:27ba with SMTP id gn4-20020a1709070d0400b0076ee20827bamr1937080ejc.652.1663836591032; Thu, 22 Sep 2022 01:49:51 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id o10-20020a50c90a000000b00455262f83aasm543028edh.32.2022.09.22.01.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 17/26] qed: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:15 +0200 Message-Id: <20220922084924.201610-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/qed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qed.c b/block/qed.c index 40943e679b..8b6a5288c5 100644 --- a/block/qed.c +++ b/block/qed.c @@ -254,7 +254,7 @@ static CachedL2Table *qed_new_l2_table(BDRVQEDState *s) return l2_table; } -static bool qed_plug_allocating_write_reqs(BDRVQEDState *s) +static bool coroutine_fn qed_plug_allocating_write_reqs(BDRVQEDState *s) { qemu_co_mutex_lock(&s->table_lock); @@ -273,7 +273,7 @@ static bool qed_plug_allocating_write_reqs(BDRVQEDState *s) return true; } -static void qed_unplug_allocating_write_reqs(BDRVQEDState *s) +static void coroutine_fn qed_unplug_allocating_write_reqs(BDRVQEDState *s) { qemu_co_mutex_lock(&s->table_lock); assert(s->allocating_write_reqs_plugged); From patchwork Thu Sep 22 08:49:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=No+XM4wX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9cn3w1Nz1ypf for ; Thu, 22 Sep 2022 19:55:04 +1000 (AEST) Received: from localhost ([::1]:41788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIv5-0004lO-Tx for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:54:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuA-0004VD-4N for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu7-0003Ev-U2 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836595; 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=I0XBVyfDqjzvf1WZr9xGpHcqO3KsnFZvkMQO+nzqMzY=; b=No+XM4wXRA5NfmUHG2FGRXzmSikqry0oDt10vjFpvNnkwQwSbQsqClnoYr5tFIV/Uc8iex hNYNEM8Sl4zZL7p3T41KdR8QCSEsrH84UIfLkWCHrr61DoHPvhFnzUSoO3nN69qbdcJ6JU 7JuEpz2c+NcvWB4G54kV7gKOJTzOIRE= 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_128_GCM_SHA256) id us-mta-61-93CjqVwQPZavL7JP1Z5NDw-1; Thu, 22 Sep 2022 04:49:53 -0400 X-MC-Unique: 93CjqVwQPZavL7JP1Z5NDw-1 Received: by mail-ed1-f72.google.com with SMTP id e15-20020a056402190f00b0044f41e776a0so6175673edz.0 for ; Thu, 22 Sep 2022 01:49:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=I0XBVyfDqjzvf1WZr9xGpHcqO3KsnFZvkMQO+nzqMzY=; b=jLR1svsVCRIQEqOV7S9eTl0ftzdUEnsaynvURG7WA5qOaIB0eiH+tU7SSERRy4om5O +2sX0oy7e2gD5muXNUUBbzu2fUuWTZA7u4WszzGxqhqv5+WSBKgd+Uv6QXkgPh5aMiyY KwcOkYY+ALt2pzEBe9bWpO8MORrddGwYLPykZ1VhVyXFPgaty8reACbZ8Yl5cnhghmW2 EjO+ZAjLLlTbDwYWIn+TxISIQ17MPnZvfcRH0Ri4u6yv7+mxoS5pJLIHWjsRqceaXS32 VnQiUkqFg2vnH81f9mMIEis5LZD1pqZBEQL2o0nGJd/1miIeQDKyPOrq1/o5RPgDnpJq QwQA== X-Gm-Message-State: ACrzQf0bPwnFINiuNv1pxTx7KT7tuUiYyeiUrjrjtGRJzhJGPzEX56O4 yjQCBn5NBZRC2W/a5+XXhcpyhVVbcV+4rla2Wd4Awbsu1s4eKfeVTHGcrE0Bz6oRe7NueAew4rn vGIdm5GiKbw9sHc8CYvD3+wL43AcmlSDcuepUOBVO8jjg3W6gxOtK1kpgMjMoKqmabUU= X-Received: by 2002:a17:906:ef8c:b0:77c:8d9a:9aed with SMTP id ze12-20020a170906ef8c00b0077c8d9a9aedmr1911464ejb.704.1663836592628; Thu, 22 Sep 2022 01:49:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pKH6N2UcKfR4P6+GzYa8xHSDgtkNV9bqibAD6ewNJiUWhmkbMHS1MgcEHwRYJp/GdZN6KWw== X-Received: by 2002:a17:906:ef8c:b0:77c:8d9a:9aed with SMTP id ze12-20020a170906ef8c00b0077c8d9a9aedmr1911440ejb.704.1663836592322; Thu, 22 Sep 2022 01:49:52 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id q27-20020a056402249b00b004542e65337asm3300883eda.51.2022.09.22.01.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 18/26] quorum: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:16 +0200 Message-Id: <20220922084924.201610-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/quorum.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index f33f30d36b..5ff69d7443 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -161,11 +161,10 @@ static bool quorum_64bits_compare(QuorumVoteValue *a, QuorumVoteValue *b) return a->l == b->l; } -static QuorumAIOCB *quorum_aio_get(BlockDriverState *bs, - QEMUIOVector *qiov, - uint64_t offset, - uint64_t bytes, - int flags) +static QuorumAIOCB *coroutine_fn quorum_aio_get(BlockDriverState *bs, + QEMUIOVector *qiov, + uint64_t offset, uint64_t bytes, + int flags) { BDRVQuorumState *s = bs->opaque; QuorumAIOCB *acb = g_new(QuorumAIOCB, 1); @@ -273,7 +272,7 @@ static void quorum_report_bad_versions(BDRVQuorumState *s, } } -static void quorum_rewrite_entry(void *opaque) +static void coroutine_fn quorum_rewrite_entry(void *opaque) { QuorumCo *co = opaque; QuorumAIOCB *acb = co->acb; @@ -574,7 +573,7 @@ free_exit: quorum_free_vote_list(&acb->votes); } -static void read_quorum_children_entry(void *opaque) +static void coroutine_fn read_quorum_children_entry(void *opaque) { QuorumCo *co = opaque; QuorumAIOCB *acb = co->acb; @@ -602,7 +601,7 @@ static void read_quorum_children_entry(void *opaque) } } -static int read_quorum_children(QuorumAIOCB *acb) +static int coroutine_fn read_quorum_children(QuorumAIOCB *acb) { BDRVQuorumState *s = acb->bs->opaque; int i; @@ -643,7 +642,7 @@ static int read_quorum_children(QuorumAIOCB *acb) return acb->vote_ret; } -static int read_fifo_child(QuorumAIOCB *acb) +static int coroutine_fn read_fifo_child(QuorumAIOCB *acb) { BDRVQuorumState *s = acb->bs->opaque; int n, ret; @@ -664,8 +663,9 @@ static int read_fifo_child(QuorumAIOCB *acb) return ret; } -static int quorum_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, - QEMUIOVector *qiov, BdrvRequestFlags flags) +static int coroutine_fn quorum_co_preadv(BlockDriverState *bs, + int64_t offset, int64_t bytes, + QEMUIOVector *qiov, BdrvRequestFlags flags) { BDRVQuorumState *s = bs->opaque; QuorumAIOCB *acb = quorum_aio_get(bs, qiov, offset, bytes, flags); @@ -684,7 +684,7 @@ static int quorum_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, return ret; } -static void write_quorum_entry(void *opaque) +static void coroutine_fn write_quorum_entry(void *opaque) { QuorumCo *co = opaque; QuorumAIOCB *acb = co->acb; @@ -715,9 +715,9 @@ static void write_quorum_entry(void *opaque) } } -static int quorum_co_pwritev(BlockDriverState *bs, int64_t offset, - int64_t bytes, QEMUIOVector *qiov, - BdrvRequestFlags flags) +static int coroutine_fn quorum_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, + BdrvRequestFlags flags) { BDRVQuorumState *s = bs->opaque; QuorumAIOCB *acb = quorum_aio_get(bs, qiov, offset, bytes, flags); @@ -746,8 +746,9 @@ static int quorum_co_pwritev(BlockDriverState *bs, int64_t offset, return ret; } -static int quorum_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int64_t bytes, BdrvRequestFlags flags) +static int coroutine_fn quorum_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, int64_t bytes, + BdrvRequestFlags flags) { return quorum_co_pwritev(bs, offset, bytes, NULL, From patchwork Thu Sep 22 08:49:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JGKMmbON; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY91t6gg0z1yqW for ; Thu, 22 Sep 2022 19:28:18 +1000 (AEST) Received: from localhost ([::1]:60196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIVE-0001ch-QV for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:28:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuB-0004WM-HH for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHu9-0003FM-Sd for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:49:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836596; 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=hMyrsH6flMrRHoTLooSRFWvZ6rfjgHHnfaNWVEG2s4w=; b=JGKMmbON7ONVaGMr71c3FFndFVjqUkqRiKKUI0RSl1cJU57jqqKvWRkS8784Z4Orc3N8Ew WWR8Akh5VFydkMxA2XTc9Cjt7AbuPr0Oi+PUTRRY1FJrWhKc4YxrWjdZ6lRkgRX0d2kSUP FLCJPPA/40EfmZiAuCpJUgBU1w3O2p4= 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_128_GCM_SHA256) id us-mta-464-rHaJnK1HNKOfFGOLECAGjQ-1; Thu, 22 Sep 2022 04:49:55 -0400 X-MC-Unique: rHaJnK1HNKOfFGOLECAGjQ-1 Received: by mail-ed1-f70.google.com with SMTP id dz21-20020a0564021d5500b0045217702048so6133724edb.5 for ; Thu, 22 Sep 2022 01:49:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=hMyrsH6flMrRHoTLooSRFWvZ6rfjgHHnfaNWVEG2s4w=; b=0Iw5wSSytmXfBff1kjH5pWJ5zu2oJ7XhLUBSzVuEk1pVPLtrBUaOb5BgxRrhTQ+8W3 VVMKxx3u+mO2qAej8/1LjGyez7gcz3umFzafDwJG6sGDqHq1DrQiC2mq1aO03kYiNmiG kxRDFkN7pADk+7Fre/599JqChJgBOWZOHl67onxjxIo3Zpf2MjLXPctgnc5Opp8w66EE Lvtv+3wiMAScdQGZwn79I7ekW/PHkW+mXgQ1/4BLKDdKtyb3Al2L6grbBU+54I4Bgj2T VzRuDvHz2STfuDuj+k3eIViOz1MJ20CGqyfjY6NJH2x1bQaC1Xfk7885DgeV+UucuxTs hj9w== X-Gm-Message-State: ACrzQf1Ohga/+31RytF/c5/VQDxuzV5SVAEAeEdkA7dWQXFK1czyzKDR 9dzVa3t339OOO9DxrY2eOmAUZeD/nka3ZFVq06nzpg4fXBgjLbrA6t66PiLGAXmKgmHHGsnlZlr eG99xLLdrJa4JrJuxYCK63putIBP9CMFSKWfdFnUt0tlavS5EJ+aQ9NYPCbGDepYgGzs= X-Received: by 2002:a17:906:847b:b0:773:db0f:d533 with SMTP id hx27-20020a170906847b00b00773db0fd533mr1908585ejc.0.1663836593953; Thu, 22 Sep 2022 01:49:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4T/ePeV0dljIx8aQjrbTRqhtjmviIwpsLGx8I3coEtaazCnt4nx0QERRMbqKn97AShhF94ZQ== X-Received: by 2002:a17:906:847b:b0:773:db0f:d533 with SMTP id hx27-20020a170906847b00b00773db0fd533mr1908569ejc.0.1663836593724; Thu, 22 Sep 2022 01:49:53 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id i14-20020a50fc0e000000b0044792480994sm3217874edr.68.2022.09.22.01.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 19/26] throttle: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:17 +0200 Message-Id: <20220922084924.201610-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/throttle.c b/block/throttle.c index 6e8d52fa24..ddd450593a 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -162,7 +162,7 @@ static int coroutine_fn throttle_co_pwritev_compressed(BlockDriverState *bs, BDRV_REQ_WRITE_COMPRESSED); } -static int throttle_co_flush(BlockDriverState *bs) +static int coroutine_fn throttle_co_flush(BlockDriverState *bs) { return bdrv_co_flush(bs->file->bs); } From patchwork Thu Sep 22 08:49:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yv4nVDol; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9p73d01z1yqW for ; Thu, 22 Sep 2022 20:03:10 +1000 (AEST) Received: from localhost ([::1]:46662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obJ2v-0003Rz-5a for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 06:03:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuD-0004X6-1W for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuA-0003Fb-FM for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836597; 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=3wwzh3LZ3A3YlWSfvO4liFhM0kWBTm1zGZfGRa3JTzY=; b=Yv4nVDolCM1Wv7jbBUiquNgPq8ZISbbEsesws5R+iccGZWK1PIKuk88QroOUR83WZx8eLX VtTbF4l+w1esxYK1LsIWP59c22kCGXQwysehUCRewaHPhM3MB9r+khEQJMhuqws4ldp0I4 nTx/tBhmFHAEp7fi/I/FQ+ttgbB9ANk= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-8-mIQ4ljSCONa8hwr4c2jrug-1; Thu, 22 Sep 2022 04:49:56 -0400 X-MC-Unique: mIQ4ljSCONa8hwr4c2jrug-1 Received: by mail-ej1-f69.google.com with SMTP id dt13-20020a170907728d00b007825956d979so427936ejc.15 for ; Thu, 22 Sep 2022 01:49:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=3wwzh3LZ3A3YlWSfvO4liFhM0kWBTm1zGZfGRa3JTzY=; b=OayvQwAZTv1JHBRUOEzBdz4bDoTFuNWEtFzh21QhW57xxUQ2KibiV+CAhtisoq+0UM FAcFSXPySElAjQK0M42z4HNpC4saJZ+s6gu9Lej0Ac/rNp4NtXUjXyp1dS62KiwW0Vjz dM2LtlynUzDotMtDiPxs2lnZI2KzccQcuY5xvoq/gKMg3ecK/S1NNqSsH3JLcC9BoZMg snsp/C/V1ElW6bygilO6gxa4mgdDuly4jGBAfIWBRARakzjJGOwSubyqiRVpti27NtL7 XMZYO3hY6sA1RF5bePzHJ6fwLC6PZSbYjHHu0M06zhgRslh0aMWbiyFyyJQsYYwP9PQB WGrA== X-Gm-Message-State: ACrzQf3hRPAWeQaB+aLsvUzOleLbYoLd2so77BddPISMW5YIVpDveB+V vDfUOE2lRANqC5BOzjWlMtfm0MeWK9EEF6YXxr+J6s8Y9bHeyb2TCLm64OwKttjLNXIggKLLKpz OcLDXlMhu0wLdMwpGNrEbYgmCTcy6XpAjZjFqR2rzMOZXo9S5dRGnToTTjQ5OUCvNm+A= X-Received: by 2002:a17:907:7621:b0:741:6656:bd14 with SMTP id jy1-20020a170907762100b007416656bd14mr1812920ejc.298.1663836595372; Thu, 22 Sep 2022 01:49:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kS4kFvGNzTzNNX5/k2HH2ygZizwrOyxILTdQOgo05urL19ln/7rR6+U4igPkPDJXVuFg/Bw== X-Received: by 2002:a17:907:7621:b0:741:6656:bd14 with SMTP id jy1-20020a170907762100b007416656bd14mr1812901ejc.298.1663836595037; Thu, 22 Sep 2022 01:49:55 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id 11-20020a170906328b00b007389c5a45f0sm2315312ejw.148.2022.09.22.01.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 20/26] vmdk: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:18 +0200 Message-Id: <20220922084924.201610-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/vmdk.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index fe07a54866..34b5e3f52e 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1787,10 +1787,10 @@ static int coroutine_fn vmdk_co_block_status(BlockDriverState *bs, return ret; } -static int vmdk_write_extent(VmdkExtent *extent, int64_t cluster_offset, - int64_t offset_in_cluster, QEMUIOVector *qiov, - uint64_t qiov_offset, uint64_t n_bytes, - uint64_t offset) +static int coroutine_fn vmdk_write_extent(VmdkExtent *extent, int64_t cluster_offset, + int64_t offset_in_cluster, QEMUIOVector *qiov, + uint64_t qiov_offset, uint64_t n_bytes, + uint64_t offset) { int ret; VmdkGrainMarker *data = NULL; @@ -1868,9 +1868,9 @@ static int vmdk_write_extent(VmdkExtent *extent, int64_t cluster_offset, return ret; } -static int vmdk_read_extent(VmdkExtent *extent, int64_t cluster_offset, - int64_t offset_in_cluster, QEMUIOVector *qiov, - int bytes) +static int coroutine_fn vmdk_read_extent(VmdkExtent *extent, int64_t cluster_offset, + int64_t offset_in_cluster, QEMUIOVector *qiov, + int bytes) { int ret; int cluster_bytes, buf_bytes; @@ -2015,9 +2015,9 @@ fail: * * Returns: error code with 0 for success. */ -static int vmdk_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, - bool zeroed, bool zero_dry_run) +static int coroutine_fn vmdk_pwritev(BlockDriverState *bs, uint64_t offset, + uint64_t bytes, QEMUIOVector *qiov, + bool zeroed, bool zero_dry_run) { BDRVVmdkState *s = bs->opaque; VmdkExtent *extent = NULL; From patchwork Thu Sep 22 08:49:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QTuZS+73; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9Cr3HH9z1yqW for ; Thu, 22 Sep 2022 19:36:56 +1000 (AEST) Received: from localhost ([::1]:52802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIdZ-0007d1-Ag for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:36:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuE-0004XP-9P for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuC-0003Fy-P8 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836600; 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=ZJE4UpzADeZRyzZ3OwaQDec/7oqi/5qTZW8F7H71V7Q=; b=QTuZS+73YsaRwNEvYgB6l+QbhsIo5JqlSkKIgjcvK+tkg+siw6/WC8i7otmiBdm7MNsJmJ d7HePXMYkUi+g/HRWAM4GZ5+3soR5x3Auizp30KuNw4h5CgjkeNhsZw5ArV+nlTs30z3Sb cH1dvyX266fBFM9iH2Y1dqMJLattGcM= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-192-rz3N35uFOiu25dNvtR39wQ-1; Thu, 22 Sep 2022 04:49:58 -0400 X-MC-Unique: rz3N35uFOiu25dNvtR39wQ-1 Received: by mail-ed1-f71.google.com with SMTP id m13-20020a056402510d00b004519332f0b1so6150398edd.7 for ; Thu, 22 Sep 2022 01:49:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=ZJE4UpzADeZRyzZ3OwaQDec/7oqi/5qTZW8F7H71V7Q=; b=yaaQQKnnQJILGcPpKkFztXpqhiqH81pPcnn+xHiYATBnv0p3pX+lmZS1QZeFwwvvfM 1+rWFpKl+Eos8ObpnOP4cIFFXRFl/rD//6ICIjMsBha96wQnwuaAkZklg5Ti8ah8smkL CPSUVU5IYF0rqE7uB9lPiAI2Nq1o3QlVznFbsmjtds9Xcie5XWOlWFerh1V5l9+lxsNO +7QUzaVVdKoVIAPRELkAHCZovqZ6oWBayJFDyB8E1fLxZ3prXXJcv3BpuOY8BMWGrSd7 zuQWj/pALxeoedw0eoWF8VbmPU2eiP4tKwR1FVJtvL0fVl+G+2ZAAp84HQbsSVUpISd4 +9wQ== X-Gm-Message-State: ACrzQf2OTD93JJqHFSbfZSMkfEjTgq9agqcGXO4GbHAFPxvnGzWBHXoZ Y5kFJLUKpy9gAEImM+GjAwBFGDkoJ3W0iFep8axwVEKS2My+XKeBaymaKMC+ayZcfUZgy0MXv/d 3rW+eH+yzi/mAx4ejOcebgD+WlIEEIQyDlOBSp5rogCjcguN6o0PCqfj5Vc/HdWtKmyE= X-Received: by 2002:a05:6402:4441:b0:454:8a74:5459 with SMTP id o1-20020a056402444100b004548a745459mr2099167edb.155.1663836597541; Thu, 22 Sep 2022 01:49:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jcRq8G06sI8m5ZrKWxsq22GSCjWdkzUXi9raRETmkfnQ/YpFHb5HZ+s9T1QxoUWX/j1m6vA== X-Received: by 2002:a05:6402:4441:b0:454:8a74:5459 with SMTP id o1-20020a056402444100b004548a745459mr2099147edb.155.1663836597268; Thu, 22 Sep 2022 01:49:57 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id u4-20020a170906780400b00777557d1ea2sm2339381ejm.47.2022.09.22.01.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 21/26] job: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:19 +0200 Message-Id: <20220922084924.201610-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- include/qemu/job.h | 2 +- job.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/job.h b/include/qemu/job.h index c105b31076..397ac39608 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -436,7 +436,7 @@ void coroutine_fn job_pause_point(Job *job); * * Yield the job coroutine. */ -void job_yield(Job *job); +void coroutine_fn job_yield(Job *job); /** * @job: The job that calls the function. diff --git a/job.c b/job.c index 075c6f3a20..20f0d8b2cd 100644 --- a/job.c +++ b/job.c @@ -525,7 +525,7 @@ void coroutine_fn job_pause_point(Job *job) } } -void job_yield(Job *job) +void coroutine_fn job_yield(Job *job) { assert(job->busy); From patchwork Thu Sep 22 08:49:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YanAbPBM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MYB5p6zYKz1yqW for ; Thu, 22 Sep 2022 20:16:46 +1000 (AEST) Received: from localhost ([::1]:56582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obJG8-00073Q-Ii for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 06:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuI-0004Xp-Ey for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuF-0003OS-KN for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836602; 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=jlRpmw13yJeY3J6UUIbgkGjukH3jdpT3L4F+RsRzNo4=; b=YanAbPBMjD9QymQ3XkjtkJtODQfVAZjyExHoh+nwz6jTYxGaqWvrwH0zNKqB0jIDgN9HSI oWU9vkue2dMDEvM6z2leVfuAKXJVZ+hdhBoJYgd4hSA3SsitzLRj29dHZkSMAc/rHZpPcK 9pTSQ8KZD660KKJjgffXDoeV4p9Ojjs= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-372-6LSp7yXeNUGOfMBn5JBU5A-1; Thu, 22 Sep 2022 04:50:00 -0400 X-MC-Unique: 6LSp7yXeNUGOfMBn5JBU5A-1 Received: by mail-ed1-f71.google.com with SMTP id x5-20020a05640226c500b00451ec193793so6220131edd.16 for ; Thu, 22 Sep 2022 01:50:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=jlRpmw13yJeY3J6UUIbgkGjukH3jdpT3L4F+RsRzNo4=; b=gD+wSFvOsajbtGaJ+VBxgpIyCC4HF5vujjgRwN0oX0w/73bObxHRBEXZPyulF2Ritk WtqFdbv17+UuR4+tmfpoOMqGTMTEvQfuDzmjoIy8H4Kz7Rv6T547lyjtPIXtY+yBcNQf cn+LHgXVWk1AW3PHFR8p4LuqOO9IwMxKVTMuW7knZhcL44gASNnPqPEUD6Svk2gFkZbD LSh9kqWd/lw9SaUWsVcJxywEb+Iz5P8FY2RrhXq8WfaWh1Ewg+Tf5z4aA5pi0z1ul6To Zq5f1hxienQqGFYf2o6TiJirRt1nq7vlF/vFiPdC2i1weOG67mIqeEAepSjTBbGx9rmp kByw== X-Gm-Message-State: ACrzQf1k/lo4jzFD1zmcGbAonUk3Bn86tN+BXPy8MJGtIhCMD/FKwcRd puvqj3yPDQzWOqeJeG5iceRGMp/sxfZt9WeCHYFfnUrnAQAxaAmLoBew9Gwb8+nhGCyA3arlc5h 9iyIcCeGoMwIjXfd4Np+Nmbt0eyiVSc/rdcyUNQJLLSIipOJj/uZ84Y/vnwXgNeTUNFE= X-Received: by 2002:a17:907:97d1:b0:780:26c9:1499 with SMTP id js17-20020a17090797d100b0078026c91499mr1793143ejc.371.1663836598852; Thu, 22 Sep 2022 01:49:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72rT8ihUE4xzn+H1NVMPs5/DtDo1rot23CMOz7Tg0ofooezRv1uP6pznS7C177EOeS5DwIFA== X-Received: by 2002:a17:907:97d1:b0:780:26c9:1499 with SMTP id js17-20020a17090797d100b0078026c91499mr1793120ejc.371.1663836598592; Thu, 22 Sep 2022 01:49:58 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x14-20020a056402414e00b0043bea0a48d0sm3297390eda.22.2022.09.22.01.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 22/26] coroutine-lock: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:20 +0200 Message-Id: <20220922084924.201610-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 9ad24ab1af..15c82d9348 100644 --- a/util/qemu-coroutine-lock.c +++ b/util/qemu-coroutine-lock.c @@ -135,7 +135,7 @@ typedef struct CoWaitRecord { QSLIST_ENTRY(CoWaitRecord) next; } CoWaitRecord; -static void push_waiter(CoMutex *mutex, CoWaitRecord *w) +static void coroutine_fn push_waiter(CoMutex *mutex, CoWaitRecord *w) { w->co = qemu_coroutine_self(); QSLIST_INSERT_HEAD_ATOMIC(&mutex->from_push, w, next); @@ -332,7 +332,7 @@ void qemu_co_rwlock_init(CoRwlock *lock) } /* Releases the internal CoMutex. */ -static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) +static void coroutine_fn qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) { CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets); Coroutine *co = NULL; @@ -365,7 +365,7 @@ static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) } } -void qemu_co_rwlock_rdlock(CoRwlock *lock) +void coroutine_fn qemu_co_rwlock_rdlock(CoRwlock *lock) { Coroutine *self = qemu_coroutine_self(); @@ -390,7 +390,7 @@ void qemu_co_rwlock_rdlock(CoRwlock *lock) self->locks_held++; } -void qemu_co_rwlock_unlock(CoRwlock *lock) +void coroutine_fn qemu_co_rwlock_unlock(CoRwlock *lock) { Coroutine *self = qemu_coroutine_self(); @@ -408,7 +408,7 @@ void qemu_co_rwlock_unlock(CoRwlock *lock) qemu_co_rwlock_maybe_wake_one(lock); } -void qemu_co_rwlock_downgrade(CoRwlock *lock) +void coroutine_fn qemu_co_rwlock_downgrade(CoRwlock *lock) { qemu_co_mutex_lock(&lock->mutex); assert(lock->owners == -1); @@ -418,7 +418,7 @@ void qemu_co_rwlock_downgrade(CoRwlock *lock) qemu_co_rwlock_maybe_wake_one(lock); } -void qemu_co_rwlock_wrlock(CoRwlock *lock) +void coroutine_fn qemu_co_rwlock_wrlock(CoRwlock *lock) { Coroutine *self = qemu_coroutine_self(); @@ -438,7 +438,7 @@ void qemu_co_rwlock_wrlock(CoRwlock *lock) self->locks_held++; } -void qemu_co_rwlock_upgrade(CoRwlock *lock) +void coroutine_fn qemu_co_rwlock_upgrade(CoRwlock *lock) { qemu_co_mutex_lock(&lock->mutex); assert(lock->owners > 0); From patchwork Thu Sep 22 08:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eP/RpE3z; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MYB122pXhz1ypf for ; Thu, 22 Sep 2022 20:12:37 +1000 (AEST) Received: from localhost ([::1]:40724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obJC5-0002Qv-1w for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 06:12:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuG-0004XS-Om for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuF-0003Kc-7X for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836602; 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=dgOi7vAF4ipXIXW0KsqPLZlNYbP7Q8ITUi2hsfHmSgE=; b=eP/RpE3z4QrBh23ORBsSY5WFmpNzH+kpvkwjkmsLh2YvMVkRBvhQ4rJKRT8fwPTaujnkl8 d48aKXoJjL7KhAfMCjvBEwZKKLtHV+mcYposHlEwPRh0QteC8u/8IYcDOzwbcXL79mv+Yc 2VIqYPj1KSJ51YBx/b2d2j1e90PkcqY= 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_128_GCM_SHA256) id us-mta-402-SUGAYeEBPtmhBy8y44YFBQ-1; Thu, 22 Sep 2022 04:50:01 -0400 X-MC-Unique: SUGAYeEBPtmhBy8y44YFBQ-1 Received: by mail-ed1-f72.google.com with SMTP id f10-20020a0564021e8a00b00451be6582d5so6217004edf.15 for ; Thu, 22 Sep 2022 01:50:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=dgOi7vAF4ipXIXW0KsqPLZlNYbP7Q8ITUi2hsfHmSgE=; b=0QWdlXqlGoVYpmBf7QG+ygjUmZsP8bfgurit1HV6RGO0Ctj7LatrEGxGR4HFxE2IfK hopJr+y7YTn1ELd/GyUn3AQRDxNmPWvlyTjtczuWTikhEpTe+UoIx3vC2l9ce6KhD6Tu RWSvvsd2AaZ8Ze/nStxQDmFYblU2EIW8mUaHorv0S7PwquM03X20OUakleaP7i5o7fu8 vcQ7dte3jX2Qy8J/KVhF/3nDkDrKs3l+Ys3q94V93m3nt1YyLAAMwJMkP7g6qlUsErSM mHbgu8/bzSzXCAMnRmQVeWyc8AXVLGG1W9VFj+OfriC0ejuUbyaqUUm9cLbg5KGWKj5c JQFg== X-Gm-Message-State: ACrzQf3kKBKJdCNiCXesdZht6QcvnTsUskUw8Qtf6Zc1D7uWuMCaK9us fJA4cvEUycNME+qb53dZO//ibZ/n3BMsimBUVKiZfSyTuBUJ3lqVAIs5YPtL6I9NjB8ZAJRtiN3 +w/il0ajMeLL4OiAqSrmCRS3ltO750dIMRaCJ2H2+u/0FRZGjzNg+g1t0dLKF8u+F1sA= X-Received: by 2002:a17:907:9490:b0:781:c079:1294 with SMTP id dm16-20020a170907949000b00781c0791294mr1956095ejc.29.1663836600107; Thu, 22 Sep 2022 01:50:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79VI+tSCtK6t4Y5zFEEAtK6h+A5FMxZxBqTPkO3kjMYeF4W73ESzMk+hbyx/rLFniFAE5Vjg== X-Received: by 2002:a17:907:9490:b0:781:c079:1294 with SMTP id dm16-20020a170907949000b00781c0791294mr1956077ejc.29.1663836599836; Thu, 22 Sep 2022 01:49:59 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id x14-20020a05640226ce00b004544bdd56a4sm3331463edd.89.2022.09.22.01.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:49:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com Subject: [PATCH 23/26] raw-format: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:21 +0200 Message-Id: <20220922084924.201610-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/raw-format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/raw-format.c b/block/raw-format.c index 69fd650eaf..45440345b6 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -411,7 +411,7 @@ static void raw_lock_medium(BlockDriverState *bs, bool locked) bdrv_lock_medium(bs->file->bs, locked); } -static int raw_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) +static int coroutine_fn raw_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) { BDRVRawState *s = bs->opaque; if (s->offset || s->has_size) { From patchwork Thu Sep 22 08:49:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gvfvf9VJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY96h6RKtz1ypf for ; Thu, 22 Sep 2022 19:32:28 +1000 (AEST) Received: from localhost ([::1]:40906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIZG-0005NW-PC for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:32:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuO-0004YH-3f for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuJ-0003SQ-J6 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836606; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zy9hH9UGcVPO94N0r3wVdZNTgpTkq2Z804XTGmHYlxg=; b=gvfvf9VJrIvAgPTbRabm/XN9C6LALhXyuvGy2fnsu8dUOsJuJwtav/pWB+4ooOzqeXzLs7 YLRQ98NzYenkLv1Fgq1VSH/kSvNPXv6HuN4OhnDW5yP/neAPQ5vwAQszNqaGykf74o+s8M Fsw3Ipx9jUrcxZXhrf1bbYDDeCOWpng= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-284-HkF0J4rtMKGC4LuF1wvMNw-1; Thu, 22 Sep 2022 04:50:02 -0400 X-MC-Unique: HkF0J4rtMKGC4LuF1wvMNw-1 Received: by mail-ej1-f72.google.com with SMTP id oz30-20020a1709077d9e00b0077239b6a915so4184664ejc.11 for ; Thu, 22 Sep 2022 01:50:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=zy9hH9UGcVPO94N0r3wVdZNTgpTkq2Z804XTGmHYlxg=; b=jShtw5iCVkI/pmEzj7q4NSOLcE8bFdcyrdC56GNfy93zHeui6PbptVnYVDfk2f+Ze9 KFrnDc9duHA0yOtb/2qK8M9CSy+1znu54otVJsn73YjzO3Ul2kxRHzhINsLOU44brLWR BoaAWN2ofitbTE+b6EOQs3sBHcr54rR5t/d/m7NH7krfJw7N3av01z8vTXWlSP6HWVva BkW7t4E5t/zU1PAuQe6L0jju1O3WMTdZUob6b2cVcXqVGDgq9dPI9EaWTaMS+tIkPakI rVpFtDQ7T4kUlOiyNrm+7T/XS7gIQf34kkD4DMVVavU1gb3o/zhyZNHG4q2W3jdVUqid kDlQ== X-Gm-Message-State: ACrzQf1PgA0yAPgvDIzbZXrkDczJg0UTsoru9OsA7eRR4atFqehSYbeH s7kVsDP5KsVVrVbuuotJcfFemTQy9Vk8nZlbVpAMIzPhn/2BZs4fc9/gd2DgPCE91htWqkBQotI +//3GDdGA7AKiKdmU1OsGrSwUy7chiiumfAJJA32H89AGKdtWTCoy0DMvMpdxt5c9348= X-Received: by 2002:a17:907:31c3:b0:770:852b:71a2 with SMTP id xf3-20020a17090731c300b00770852b71a2mr1828981ejb.557.1663836601450; Thu, 22 Sep 2022 01:50:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ii/Aim2Hw7tzlUEn8Ye3yHbxQztvJEuZZNE9Em7K4uYqI2bHIXqvPhesn7eZmgVeq61co4Q== X-Received: by 2002:a17:907:31c3:b0:770:852b:71a2 with SMTP id xf3-20020a17090731c300b00770852b71a2mr1828961ejb.557.1663836601116; Thu, 22 Sep 2022 01:50:01 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id f19-20020a056402195300b004531b137e4bsm3298612edz.67.2022.09.22.01.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:50:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, =?utf-8?q?Ma?= =?utf-8?q?rc-Andr=C3=A9_Lureau?= , Greg Kurz Subject: [PATCH 24/26] 9p: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:22 +0200 Message-Id: <20220922084924.201610-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Marc-André Lureau Acked-by: Greg Kurz Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- hw/9pfs/9p.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 994f952600..a523ac34a9 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -424,21 +424,24 @@ typedef struct V9fsGetlock extern int open_fd_hw; extern int total_open_fd; -static inline void v9fs_path_write_lock(V9fsState *s) +static inline void coroutine_fn +v9fs_path_write_lock(V9fsState *s) { if (s->ctx.export_flags & V9FS_PATHNAME_FSCONTEXT) { qemu_co_rwlock_wrlock(&s->rename_lock); } } -static inline void v9fs_path_read_lock(V9fsState *s) +static inline void coroutine_fn +v9fs_path_read_lock(V9fsState *s) { if (s->ctx.export_flags & V9FS_PATHNAME_FSCONTEXT) { qemu_co_rwlock_rdlock(&s->rename_lock); } } -static inline void v9fs_path_unlock(V9fsState *s) +static inline void coroutine_fn +v9fs_path_unlock(V9fsState *s) { if (s->ctx.export_flags & V9FS_PATHNAME_FSCONTEXT) { qemu_co_rwlock_unlock(&s->rename_lock); From patchwork Thu Sep 22 08:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1681011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WRqRZfhQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY9Jk6BHBz1yqL for ; Thu, 22 Sep 2022 19:41:09 +1000 (AEST) Received: from localhost ([::1]:43624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIhd-0003Xe-SJ for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:41:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuO-0004YJ-4B for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuK-0003Se-6X for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836606; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lQfYt/ZXJmjE1TcR1De7ZzjZEgfz0xSkkoMH4Gfc/48=; b=WRqRZfhQSzRWbsXQ073f4d45ZbhEvBqP7SDjtViiWfMkhDF5Iv06bgHP6VQf2Xjyydh/R0 vlgGg0D5RD+TBKQG+3rYutUsRw0uk4S0+2OfBb+MW0ZOotM6nqq2ynUxaoLdmJKrS+DYO7 R1FkBAzQt0zxJ1pdCqc5qQbIF6HSh00= 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_128_GCM_SHA256) id us-mta-399-6Pm6RV2YNZqY1OZR1hcA_Q-1; Thu, 22 Sep 2022 04:50:04 -0400 X-MC-Unique: 6Pm6RV2YNZqY1OZR1hcA_Q-1 Received: by mail-ed1-f69.google.com with SMTP id y1-20020a056402358100b00451b144e23eso6149170edc.18 for ; Thu, 22 Sep 2022 01:50:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=lQfYt/ZXJmjE1TcR1De7ZzjZEgfz0xSkkoMH4Gfc/48=; b=4GmYFF5euQ5KVx2YRlijliph1g0HDDieyWe5sHO5OlD5QCSsE36LRBcvsGUKVfbqNt aQeDTXpbW5O+7HKoT39d7SHCyL22O2yhQqu3rB4JDLbh5e82BNerWpilQx2Qx0iWfAgv TNiwvOz4whN4q9kFrdXpN5DonX1W4qXlzFTGMCoN3uZr7+u4i/ocLOJpX3LckxJ28BIh btTN269HtT6VysqXUCEVrHACsu0S4SZh8HnSx2xjFOmNqRN2nl0mfRSp+iqps4aXMQxm DuF0qilgbT2FwhNYQ0354JsTmbC/gBoS7pDYIRUW3Qq04/cJPIWvHySX/B6G7R+wY6wQ t7Fg== X-Gm-Message-State: ACrzQf3H9RTLaa/ooeftKoSrncJvHUk0wgMQtYeEEcpFHSAduVMb03em OdZi3skWNkKilxV1eqEfW3ZdMV7zsJWWoU2Fnbz4vJJfLmnSIRCQ3mw0LfucwVhcWsZZx143XpA qcE3ho1Bd/jlVs5OImW5yF+eMkoDD2gHL0aHa44bVtcr6yAqPTafAD8nHuAcvpYPsUq4= X-Received: by 2002:a17:907:948f:b0:780:4c66:6689 with SMTP id dm15-20020a170907948f00b007804c666689mr1840395ejc.401.1663836603506; Thu, 22 Sep 2022 01:50:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cJFxX8uyRf4ElbdYuY46kfVx6+c7+iQ+tOGc0cr92qLsr2o7YirK1G8Ds2gzivpJ7M4cCUQ== X-Received: by 2002:a17:907:948f:b0:780:4c66:6689 with SMTP id dm15-20020a170907948f00b007804c666689mr1840373ejc.401.1663836603282; Thu, 22 Sep 2022 01:50:03 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id j12-20020aa7c0cc000000b00445e1489313sm3202658edp.94.2022.09.22.01.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:50:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, =?utf-8?q?Ma?= =?utf-8?q?rc-Andr=C3=A9_Lureau?= , Juan Quintela , Stefan Hajnoczi Subject: [PATCH 25/26] migration: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:23 +0200 Message-Id: <20220922084924.201610-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Marc-André Lureau Reviewed-by: Juan Quintela Reviewed-by: Stefan Hajnoczi Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- migration/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index bb8bbddfe4..739bb683f3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -574,7 +574,8 @@ static void process_incoming_migration_bh(void *opaque) migration_incoming_state_destroy(); } -static void process_incoming_migration_co(void *opaque) +static void coroutine_fn +process_incoming_migration_co(void *opaque) { MigrationIncomingState *mis = migration_incoming_get_current(); PostcopyState ps; From patchwork Thu Sep 22 08:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1680989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WGvq/u8T; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MY8lj55dpz1yqL for ; Thu, 22 Sep 2022 19:16:01 +1000 (AEST) Received: from localhost ([::1]:42886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obIJK-0006dW-HE for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2022 05:15:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuO-0004YK-51 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHuJ-0003Sh-Mz for qemu-devel@nongnu.org; Thu, 22 Sep 2022 04:50:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663836607; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uuN0RvFNXbfYw9v0uWvsWxRBJlewlxQT5whcowWTn1k=; b=WGvq/u8TOlyvL5vaoUjbs7C5IbisbT4aVMiFLHxW2KxS1Vt9rJGTydvdPdybs8P0fwTLqx eWLXe8kV01Ogl44n4G1vaa78vsTM4j4po2x6ZHMzQ9fClR5uRNXz/4YGHcC1YTybbrS5T0 0m6b7yZHDaOLKJsUpjqDig3puZF850k= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-657-dNpzcFBzO0aqzPtIMnov-w-1; Thu, 22 Sep 2022 04:50:06 -0400 X-MC-Unique: dNpzcFBzO0aqzPtIMnov-w-1 Received: by mail-ej1-f71.google.com with SMTP id sg44-20020a170907a42c00b007822e506a4fso1424923ejc.16 for ; Thu, 22 Sep 2022 01:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=uuN0RvFNXbfYw9v0uWvsWxRBJlewlxQT5whcowWTn1k=; b=KuCJ9BNKae6U8rUupCrIf8bmrf0cPdRjY1UWFVyG8r6ALT3vRYj/R4BYyFPOmu6UMK gWH0b3vevHDgSQ8r4ngbDXVvlkKPxlXaS9mwNSkm+Kg8o08RSwp5tgdVW9iiSGseyEdf PGB9s5Aryse8bRkWvewdCwkYPNe660Hq9aepKDiu+s+yDqF8WJUCBmUfY0n/LrQ3Baeo YUYOypQn8cjXtYLGWC8v219C/df3S2H3gNtXBXI7Ri4be9ZhJ1Bbub7usbDLORl2ixm8 w+HyNTPfrMB8/Cyaf1I4kAWsZ/BiueXVWjqueRf7CqSQ+CZfv5Bx9m76iaRy5VHB+RAo aQhg== X-Gm-Message-State: ACrzQf2e8nlULkYWE4xUspsROjVG7Zz0q/Nrb8nUSLYEpHl+5HVOqTH8 E/fUWOFNvklGL/1XbBjYcijILPhFbZsLhAdTBv/ldksAcHdGpnhsVGKVB4iJeSJGmiUknijHzXu zjtx6sQM/9f8pol4DfaPOnmKNkXOvToU406dWrfuB8yRaZtS5YG6hc2GR2Oy+eN+LMV8= X-Received: by 2002:aa7:cc8a:0:b0:446:7668:2969 with SMTP id p10-20020aa7cc8a000000b0044676682969mr2174205edt.206.1663836604751; Thu, 22 Sep 2022 01:50:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pLAvwf+3SaacD/apDxGVUbFaLB4YCRVvPm98M6zxzUTlF3+yMoHngapqE8s2NTcDXGaEuHQ== X-Received: by 2002:aa7:cc8a:0:b0:446:7668:2969 with SMTP id p10-20020aa7cc8a000000b0044676682969mr2174187edt.206.1663836604533; Thu, 22 Sep 2022 01:50:04 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id ay21-20020a056402203500b0044e9601e53fsm3245515edb.19.2022.09.22.01.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 01:50:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, afaria@redhat.com, =?utf-8?q?Ma?= =?utf-8?q?rc-Andr=C3=A9_Lureau?= Subject: [PATCH 26/26] test-coroutine: add missing coroutine_fn annotations Date: Thu, 22 Sep 2022 10:49:24 +0200 Message-Id: <20220922084924.201610-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922084924.201610-1-pbonzini@redhat.com> References: <20220922084924.201610-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, PP_MIME_FAKE_ASCII_TEXT=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Marc-André Lureau Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- tests/unit/test-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-coroutine.c b/tests/unit/test-coroutine.c index aa77a3bcb3..e16b80c245 100644 --- a/tests/unit/test-coroutine.c +++ b/tests/unit/test-coroutine.c @@ -610,7 +610,7 @@ static void perf_baseline(void) g_test_message("Function call %u iterations: %f s", maxcycles, duration); } -static __attribute__((noinline)) void perf_cost_func(void *opaque) +static __attribute__((noinline)) void coroutine_fn perf_cost_func(void *opaque) { qemu_coroutine_yield(); }