[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 40/50] block_int-common.h: split function pointers in BdrvChildCla
From: |
Kevin Wolf |
Subject: |
[PULL 40/50] block_int-common.h: split function pointers in BdrvChildClass |
Date: |
Fri, 4 Mar 2022 17:47:01 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-28-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/block/block_int-common.h | 81 ++++++++++++++++++--------------
1 file changed, 47 insertions(+), 34 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index f05ebb0da3..5a04c778e4 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -830,19 +830,16 @@ struct BdrvChildClass {
*/
bool parent_is_bds;
+ /*
+ * Global state (GS) API. These functions run under the BQL.
+ *
+ * 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
- * node name for identifying the node in question (in particular, a BB
- * name), or NULL if the parent can't provide a better name.
- */
- const char *(*get_name)(BdrvChild *child);
/*
* Returns a malloced string that describes the parent of the child for a
@@ -852,6 +849,47 @@ 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);
+
+ /*
+ * Returns a name that is supposedly more useful for human users than the
+ * node name for identifying the node in question (in particular, a BB
+ * name), or NULL if the parent can't provide a better name.
+ */
+ const char *(*get_name)(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
@@ -876,31 +914,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.35.1
- [PULL 29/50] GS and IO CODE macros for blockjob_int.h, (continued)
- [PULL 29/50] GS and IO CODE macros for blockjob_int.h, Kevin Wolf, 2022/03/04
- [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 <=
- [PULL 43/50] job.h: split function pointers in JobDriver, Kevin Wolf, 2022/03/04
- [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