[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 23/25] block-backend-common.h: split function pointers in Bloc
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v4 23/25] block-backend-common.h: split function pointers in BlockDevOps |
Date: |
Mon, 25 Oct 2021 06:17:33 -0400 |
Assertions in the callers of the funciton pointrs are already
added by previous patches.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@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 52ff6a4d26..9ffd098458 100644
--- a/include/sysemu/block-backend-common.h
+++ b/include/sysemu/block-backend-common.h
@@ -17,6 +17,14 @@
/* Callbacks for block device models */
typedef struct BlockDevOps {
+
+ /*
+ * 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.
+ */
+
/*
* Runs when virtual media changed (monitor commands eject, change)
* Argument load is true on load and false on eject.
@@ -34,16 +42,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.27.0
- [PATCH v4 13/25] include/sysemu/blockdev.h: move drive_add and inline drive_def, (continued)
- [PATCH v4 13/25] include/sysemu/blockdev.h: move drive_add and inline drive_def, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 15/25] assertions for blockdev.h global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 19/25] block_int-common.h: split function pointers in BlockDriver, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 17/25] block/copy-before-write.h: global state API + assertions, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 16/25] include/block/snapshot: global state API + assertions, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 18/25] block/coroutines: I/O API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 24/25] job.h: split function pointers in JobDriver, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 21/25] block_int-common.h: split function pointers in BdrvChildClass, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 22/25] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 20/25] block_int-common.h: assertion in the callers of BlockDriver function pointers, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 23/25] block-backend-common.h: split function pointers in BlockDevOps,
Emanuele Giuseppe Esposito <=
- [PATCH v4 25/25] job.h: assertions in the callers of JobDriver funcion pointers, Emanuele Giuseppe Esposito, 2021/10/25
- Re: [PATCH v4 00/25] block layer: split block APIs in global state and I/O, Philippe Mathieu-Daudé, 2021/10/25
- Re: [PATCH v4 00/25] block layer: split block APIs in global state and I/O, Stefan Hajnoczi, 2021/10/28