From nobody Fri Dec 19 22:02:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646416311; cv=none; d=zohomail.com; s=zohoarc; b=fD3vMR1Zw5khvEfz7wRxNDzb07wP53FADz9XIF2l8BHaK0uGZbbaDsmyer8VlAUjaeb/+6koFprxVqdaEiRwd1Q6e4U3KBT6/mLhjyyaiYAMDVKwnojStfL4h8JO6rZxJ+25os6WKW2+jbV0noGs7RmaJCrl2byv34Rf2kvPH9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646416311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A4RzhRojpr7Dldd+C+yNLHj5nPh+XN9kHYT/DnQGnMQ=; b=Dvpj2Hpq9XCLdEYPLvzzE0/LIgimNzDHIZBCEcjCE/gXDivCB6YYgMwwG4p8WBTzTpaX8b91j2qxeagsBuxZMNDKGqsQbLiQI8q9qa3W/yG2k5ebfjG3eT9uwOdvDBySyzdu7QEOqu/Ja0t2yiRN6Wv9oCYhAp9v0deSdmo2HAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16464163118511013.5515804167544; Fri, 4 Mar 2022 09:51:51 -0800 (PST) Received: from localhost ([::1]:37496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQC5l-0002EP-Eb for importer@patchew.org; Fri, 04 Mar 2022 12:51:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQB6U-00066r-84 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 11:48:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQB6S-0007cD-NP for qemu-devel@nongnu.org; Fri, 04 Mar 2022 11:48:29 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-IBXOnR9sOZiVLr2U1AAN0g-1; Fri, 04 Mar 2022 11:48:25 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B715180FD71; Fri, 4 Mar 2022 16:48:24 +0000 (UTC) Received: from merkur.redhat.com (unknown [10.39.194.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DF7183BF9; Fri, 4 Mar 2022 16:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646412508; 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=A4RzhRojpr7Dldd+C+yNLHj5nPh+XN9kHYT/DnQGnMQ=; b=Sj2rfXW3NQm8L4xV8xfDbxb1+KfMKQQEx1bzrdnAJqwvoYd8JILhaREg+HS6aGaY1ztQG/ ya95Mt0XoExYsuPgChC8IosTo6snpjTLcEvStCYcj643yEjnGJfSlphDtS7M4kPAD1UuZ4 Hw897ZtxgvJLo4eZYq03s7qcNEWM8aU= X-MC-Unique: IBXOnR9sOZiVLr2U1AAN0g-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 43/50] job.h: split function pointers in JobDriver Date: Fri, 4 Mar 2022 17:47:04 +0100 Message-Id: <20220304164711.474713-44-kwolf@redhat.com> In-Reply-To: <20220304164711.474713-1-kwolf@redhat.com> References: <20220304164711.474713-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646416313380100001 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito The job API will be handled separately in another serie. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20220303151616.325444-31-eesposit@redhat.com> Signed-off-by: Kevin Wolf --- include/qemu/job.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/qemu/job.h b/include/qemu/job.h index 6e67b6977f..c105b31076 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -169,6 +169,12 @@ typedef struct Job { * Callbacks and other information about a Job driver. */ struct JobDriver { + + /* + * These fields are initialized when this object is created, + * and are never changed afterwards + */ + /** Derived Job struct size */ size_t instance_size; =20 @@ -184,9 +190,18 @@ struct JobDriver { * aborted. If it returns zero, the job moves into the WAITING state. = If it * is the last job to complete in its transaction, all jobs in the * transaction move from WAITING to PENDING. + * + * This callback must be run in the job's context. */ int coroutine_fn (*run)(Job *job, Error **errp); =20 + /* + * Functions run without regard to the BQL that may run in any + * arbitrary thread. These functions do not need to be thread-safe + * because the caller ensures that they are invoked from one + * thread at time. + */ + /** * If the callback is not NULL, it will be invoked when the job transi= tions * into the paused state. Paused jobs must not perform any asynchrono= us @@ -201,6 +216,13 @@ struct JobDriver { */ void coroutine_fn (*resume)(Job *job); =20 + /* + * Global state (GS) API. These functions run under the BQL. + * + * See include/block/block-global-state.h for more information about + * the GS API. + */ + /** * Called when the job is resumed by the user (i.e. user_paused becomes * false). .user_resume is called before .resume. --=20 2.35.1