[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 29/31] block-backend-common.h: split function pointers in Bloc
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v7 29/31] block-backend-common.h: split function pointers in BlockDevOps |
Date: |
Fri, 11 Feb 2022 09:51:51 -0500 |
Assertions in the callers of the function pointrs are already
added by previous patches.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/sysemu/block-backend-common.h | 28 ++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/include/sysemu/block-backend-common.h
b/include/sysemu/block-backend-common.h
index 6963bbf45a..2391679c56 100644
--- a/include/sysemu/block-backend-common.h
+++ b/include/sysemu/block-backend-common.h
@@ -27,6 +27,14 @@
/* Callbacks for block device models */
typedef struct BlockDevOps {
+
+ /*
+ * Global state (GS) API. These functions run under the BQL.
+ *
+ * See include/block/block-global-state.h for more information about
+ * the GS API.
+ */
+
/*
* Runs when virtual media changed (monitor commands eject, change)
* Argument load is true on load and false on eject.
@@ -44,16 +52,26 @@ typedef struct BlockDevOps {
* true, even if they do not support eject requests.
*/
void (*eject_request_cb)(void *opaque, bool force);
- /*
- * Is the virtual tray open?
- * Device models implement this only when the device has a tray.
- */
- bool (*is_tray_open)(void *opaque);
+
/*
* Is the virtual medium locked into the device?
* Device models implement this only when device has such a lock.
*/
bool (*is_medium_locked)(void *opaque);
+
+ /*
+ * I/O API functions. These functions are thread-safe.
+ *
+ * See include/block/block-io.h for more information about
+ * the I/O API.
+ */
+
+ /*
+ * Is the virtual tray open?
+ * Device models implement this only when the device has a tray.
+ */
+ bool (*is_tray_open)(void *opaque);
+
/*
* Runs when the size changed (e.g. monitor command block_resize)
*/
--
2.31.1
- [PATCH v7 03/31] include/block/block: split header into I/O and global state API, (continued)
- [PATCH v7 03/31] include/block/block: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 17/31] block.c: add assertions to static functions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 14/31] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 19/31] assertions for blockjob.h global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 22/31] include/block/snapshot: global state API + assertions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 23/31] block/copy-before-write.h: global state API + assertions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 24/31] block/coroutines: I/O and "I/O or GS" API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 25/31] block_int-common.h: split function pointers in BlockDriver, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 27/31] block_int-common.h: split function pointers in BdrvChildClass, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 28/31] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 29/31] block-backend-common.h: split function pointers in BlockDevOps,
Emanuele Giuseppe Esposito <=
- [PATCH v7 30/31] job.h: split function pointers in JobDriver, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 31/31] job.h: assertions in the callers of JobDriver function pointers, Emanuele Giuseppe Esposito, 2022/02/11