[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/50] job.h: split function pointers in JobDriver
From: |
Kevin Wolf |
Subject: |
[PULL 43/50] job.h: split function pointers in JobDriver |
Date: |
Fri, 4 Mar 2022 17:47:04 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
The job API will be handled separately in another serie.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-31-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
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;
@@ -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);
+ /*
+ * 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 transitions
* into the paused state. Paused jobs must not perform any asynchronous
@@ -201,6 +216,13 @@ struct JobDriver {
*/
void coroutine_fn (*resume)(Job *job);
+ /*
+ * 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.
--
2.35.1
- [PULL 31/50] include/block/blockjob.h: global state API, (continued)
- [PULL 31/50] include/block/blockjob.h: global state API, Kevin Wolf, 2022/03/04
- [PULL 30/50] block.c: add assertions to static functions, Kevin Wolf, 2022/03/04
- [PULL 36/50] block/copy-before-write.h: global state API + assertions, Kevin Wolf, 2022/03/04
- [PULL 37/50] block/coroutines: I/O and "I/O or GS" API, Kevin Wolf, 2022/03/04
- [PULL 38/50] block_int-common.h: split function pointers in BlockDriver, Kevin Wolf, 2022/03/04
- [PULL 39/50] block_int-common.h: assertions in the callers of BlockDriver function pointers, Kevin Wolf, 2022/03/04
- [PULL 41/50] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Kevin Wolf, 2022/03/04
- [PULL 42/50] block-backend-common.h: split function pointers in BlockDevOps, Kevin Wolf, 2022/03/04
- [PULL 44/50] job.h: assertions in the callers of JobDriver function pointers, Kevin Wolf, 2022/03/04
- [PULL 40/50] block_int-common.h: split function pointers in BdrvChildClass, Kevin Wolf, 2022/03/04
- [PULL 43/50] job.h: split function pointers in JobDriver,
Kevin Wolf <=
- [PULL 45/50] block: Make bdrv_refresh_limits() non-recursive, Kevin Wolf, 2022/03/04
- [PULL 47/50] iotests/graph-changes-while-io: New test, Kevin Wolf, 2022/03/04
- [PULL 46/50] iotests: Allow using QMP with the QSD, Kevin Wolf, 2022/03/04
- [PULL 50/50] block/amend: Keep strong reference to BDS, Kevin Wolf, 2022/03/04
- [PULL 49/50] block/amend: Always call .bdrv_amend_clean(), Kevin Wolf, 2022/03/04
- [PULL 48/50] tests/qemu-iotests: Rework the checks and spots using GNU sed, Kevin Wolf, 2022/03/04
- Re: [PULL 00/50] Block layer patches, Peter Maydell, 2022/03/05