[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 25/33] block_int-common.h: split function pointers in BdrvChil
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v6 25/33] block_int-common.h: split function pointers in BdrvChildClass |
Date: |
Fri, 21 Jan 2022 12:05:36 -0500 |
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
include/block/block_int-common.h | 67 +++++++++++++++++++-------------
1 file changed, 40 insertions(+), 27 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index e007dbf768..cc8c8835ba 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -815,12 +815,16 @@ struct BdrvChildClass {
*/
bool parent_is_bds;
+ /*
+ * 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.
+ */
void (*inherit_options)(BdrvChildRole role, bool parent_is_format,
int *child_flags, QDict *child_options,
int parent_flags, QDict *parent_options);
-
void (*change_media)(BdrvChild *child, bool load);
- void (*resize)(BdrvChild *child);
/*
* Returns a name that is supposedly more useful for human users than the
@@ -837,6 +841,40 @@ struct BdrvChildClass {
*/
char *(*get_parent_desc)(BdrvChild *child);
+ /*
+ * Notifies the parent that the child has been activated/inactivated (e.g.
+ * when migration is completing) and it can start/stop requesting
+ * permissions and doing I/O on it.
+ */
+ void (*activate)(BdrvChild *child, Error **errp);
+ int (*inactivate)(BdrvChild *child);
+
+ void (*attach)(BdrvChild *child);
+ void (*detach)(BdrvChild *child);
+
+ /*
+ * Notifies the parent that the filename of its child has changed (e.g.
+ * because the direct child was removed from the backing chain), so that it
+ * can update its reference.
+ */
+ int (*update_filename)(BdrvChild *child, BlockDriverState *new_base,
+ const char *filename, Error **errp);
+
+ bool (*can_set_aio_ctx)(BdrvChild *child, AioContext *ctx,
+ GSList **ignore, Error **errp);
+ void (*set_aio_ctx)(BdrvChild *child, AioContext *ctx, GSList **ignore);
+
+ AioContext *(*get_parent_aio_context)(BdrvChild *child);
+
+ /*
+ * I/O API functions. These functions are thread-safe.
+ *
+ * See include/block/block-io.h for more information about
+ * the I/O API.
+ */
+
+ void (*resize)(BdrvChild *child);
+
/*
* If this pair of functions is implemented, the parent doesn't issue new
* requests after returning from .drained_begin() until .drained_end() is
@@ -861,31 +899,6 @@ struct BdrvChildClass {
* activity on the child has stopped.
*/
bool (*drained_poll)(BdrvChild *child);
-
- /*
- * Notifies the parent that the child has been activated/inactivated (e.g.
- * when migration is completing) and it can start/stop requesting
- * permissions and doing I/O on it.
- */
- void (*activate)(BdrvChild *child, Error **errp);
- int (*inactivate)(BdrvChild *child);
-
- void (*attach)(BdrvChild *child);
- void (*detach)(BdrvChild *child);
-
- /*
- * Notifies the parent that the filename of its child has changed (e.g.
- * because the direct child was removed from the backing chain), so that it
- * can update its reference.
- */
- int (*update_filename)(BdrvChild *child, BlockDriverState *new_base,
- const char *filename, Error **errp);
-
- bool (*can_set_aio_ctx)(BdrvChild *child, AioContext *ctx,
- GSList **ignore, Error **errp);
- void (*set_aio_ctx)(BdrvChild *child, AioContext *ctx, GSList **ignore);
-
- AioContext *(*get_parent_aio_context)(BdrvChild *child);
};
extern const BdrvChildClass child_of_bds;
--
2.31.1
- Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate, (continued)
- [PATCH v6 28/33] job.h: split function pointers in JobDriver, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 30/33] include/block/block_int-common.h: introduce bdrv_amend_pre_run and bdrv_amend_clean, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 31/33] include/qemu/job.h: introduce job->pre_run() and use it in amend, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 22/33] block/coroutines: I/O API, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 23/33] block_int-common.h: split function pointers in BlockDriver, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 25/33] block_int-common.h: split function pointers in BdrvChildClass,
Emanuele Giuseppe Esposito <=
- [PATCH v6 32/33] crypto: delegate permission functions to JobDriver .pre_run, Emanuele Giuseppe Esposito, 2022/01/21
- [PATCH v6 33/33] block.c: assertions to the block layer permissions API, Emanuele Giuseppe Esposito, 2022/01/21