[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 24/25] job.h: split function pointers in JobDriver
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v3 24/25] job.h: split function pointers in JobDriver |
Date: |
Tue, 12 Oct 2021 04:49:05 -0400 |
The job API will be handled separately in another serie.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
include/qemu/job.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 6e67b6977f..7e9e59f4b8 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -169,12 +169,21 @@ typedef struct Job {
* Callbacks and other information about a Job driver.
*/
struct JobDriver {
+
+ /* Fields initialized in struct definition and never changed. */
+
/** Derived Job struct size */
size_t instance_size;
/** Enum describing the operation */
JobType job_type;
+ /*
+ * Functions run without regard to the BQL and may run in any
+ * arbitrary thread. These functions do not need to be thread-safe
+ * because the caller ensures that are invoked from one thread at time.
+ */
+
/**
* Mandatory: Entrypoint for the Coroutine.
*
@@ -201,6 +210,13 @@ struct JobDriver {
*/
void coroutine_fn (*resume)(Job *job);
+ /*
+ * Global state (GS) API. These functions run under the BQL lock.
+ *
+ * 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.27.0
- Re: [PATCH v3 14/25] include/systemu/blockdev.h: global state API, (continued)
- [PATCH v3 19/25] block_int-common.h: split function pointers in BlockDriver, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 17/25] block/copy-before-write.h: global state API + assertions, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 15/25] assertions for blockdev.h global state API, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 16/25] include/block/snapshot: global state API + assertions, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 20/25] block_int-common.h: assertion in the callers of BlockDriver function pointers, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 18/25] block/coroutines: I/O API, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 22/25] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 23/25] block-backend-common.h: split function pointers in BlockDevOps, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 24/25] job.h: split function pointers in JobDriver,
Emanuele Giuseppe Esposito <=
- [PATCH v3 25/25] job.h: assertions in the callers of JobDriver funcion pointers, Emanuele Giuseppe Esposito, 2021/10/12