[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 21/25] block_int-common.h: split function pointers in BdrvChil
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v3 21/25] block_int-common.h: split function pointers in BdrvChildClass |
Date: |
Tue, 12 Oct 2021 04:49:02 -0400 |
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
include/block/block_int-common.h | 51 ++++++++++++++++++++------------
1 file changed, 32 insertions(+), 19 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 9857e775fe..ea16099c53 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -805,12 +805,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
@@ -827,6 +831,32 @@ struct BdrvChildClass {
*/
char *(*get_parent_desc)(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
@@ -859,23 +889,6 @@ struct BdrvChildClass {
*/
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.27.0
- Re: [PATCH v3 08/25] block: introduce assert_bdrv_graph_writable, (continued)
- [PATCH v3 10/25] assertions for blockjob_int.h, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 09/25] include/block/blockjob_int.h: split header into I/O and GS API, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 11/25] include/block/blockjob.h: global state API, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 13/25] include/sysemu/blockdev.h: move drive_add and inline drive_def, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 12/25] assertions for blockob.h global state API, Emanuele Giuseppe Esposito, 2021/10/12
- [PATCH v3 21/25] block_int-common.h: split function pointers in BdrvChildClass,
Emanuele Giuseppe Esposito <=
- [PATCH v3 14/25] include/systemu/blockdev.h: global state API, Emanuele Giuseppe Esposito, 2021/10/12
- [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