[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 14/25] include/systemu/blockdev.h: global state API
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v4 14/25] include/systemu/blockdev.h: global state API |
Date: |
Mon, 25 Oct 2021 06:17:24 -0400 |
blockdev functions run always under the BQL lock.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
include/sysemu/blockdev.h | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index 960b54d320..b07f15df09 100644
--- a/include/sysemu/blockdev.h
+++ b/include/sysemu/blockdev.h
@@ -13,9 +13,6 @@
#include "block/block.h"
#include "qemu/queue.h"
-void blockdev_mark_auto_del(BlockBackend *blk);
-void blockdev_auto_del(BlockBackend *blk);
-
typedef enum {
IF_DEFAULT = -1, /* for use with drive_add() only */
/*
@@ -40,6 +37,16 @@ struct DriveInfo {
QTAILQ_ENTRY(DriveInfo) next;
};
+/*
+ * 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 blockdev_mark_auto_del(BlockBackend *blk);
+void blockdev_auto_del(BlockBackend *blk);
+
DriveInfo *blk_legacy_dinfo(BlockBackend *blk);
DriveInfo *blk_set_legacy_dinfo(BlockBackend *blk, DriveInfo *dinfo);
BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo);
@@ -50,10 +57,13 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int
unit);
void drive_check_orphaned(void);
DriveInfo *drive_get_by_index(BlockInterfaceType type, int index);
int drive_get_max_bus(BlockInterfaceType type);
-int drive_get_max_devs(BlockInterfaceType type);
DriveInfo *drive_get_next(BlockInterfaceType type);
DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type,
Error **errp);
+/* Common functions that are neither I/O nor Global State */
+
+int drive_get_max_devs(BlockInterfaceType type);
+
#endif
--
2.27.0
- Re: [PATCH v4 02/25] include/block/block: split header into I/O and global state API, (continued)
- [PATCH v4 04/25] include/sysemu/block-backend: split header into I/O and global state (GS) API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 05/25] block/block-backend.c: assertions for block-backend, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 07/25] assertions for block_int global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 06/25] include/block/block_int: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 08/25] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 09/25] include/block/blockjob_int.h: split header into I/O and GS API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 11/25] include/block/blockjob.h: global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 12/25] assertions for blockob.h global state API, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 10/25] assertions for blockjob_int.h, Emanuele Giuseppe Esposito, 2021/10/25
- [PATCH v4 14/25] include/systemu/blockdev.h: global state API,
Emanuele Giuseppe Esposito <=
- [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