On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote:
Similar to the header split, also the function pointers in BlockDriver
can be split in I/O and global state.

Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
---
  include/block/block_int-common.h | 434 ++++++++++++++++---------------
  1 file changed, 231 insertions(+), 203 deletions(-)

diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 70534f94ae..e007dbf768 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h

[...]

@@ -159,7 +148,66 @@ struct BlockDriver {

[...]

+    /*
+     * 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.
+     */
+
+    /*
+     * Return true if @to_replace can be replaced by a BDS with the
+     * same data as @bs without it affecting @bs's behavior (that is,
+     * without it being visible to @bs's parents).
+     */
+    bool (*bdrv_recurse_can_replace)(BlockDriverState *bs,
+                                     BlockDriverState *to_replace);
+
+    int (*bdrv_probe)(const uint8_t *buf, int buf_size, const char *filename);

Considering that its only caller (bdrv_probe_all()) is now an I/O function, shouldn’t this be, too?

Hanna


Reply via email to