summaryrefslogtreecommitdiffstats
path: root/blockdev.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2022-03-03 16:15:57 +0100
committerKevin Wolf2022-03-04 18:18:25 +0100
commitb4ad82aab10ea0cfe981e94414751e26a510c280 (patch)
tree811923470433dcb7cc6279677b4f0f3b19271b38 /blockdev.c
parentinclude/block/block_int: split header into I/O and global state API (diff)
downloadqemu-b4ad82aab10ea0cfe981e94414751e26a510c280.tar.gz
qemu-b4ad82aab10ea0cfe981e94414751e26a510c280.tar.xz
qemu-b4ad82aab10ea0cfe981e94414751e26a510c280.zip
assertions for block_int global state API
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20220303151616.325444-13-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 52078e772f..12a317f149 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -69,6 +69,7 @@ QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =
void bdrv_set_monitor_owned(BlockDriverState *bs)
{
+ GLOBAL_STATE_CODE();
QTAILQ_INSERT_TAIL(&monitor_bdrv_states, bs, monitor_list);
}
@@ -629,6 +630,7 @@ BlockDriverState *bds_tree_init(QDict *bs_opts, Error **errp)
{
int bdrv_flags = 0;
+ GLOBAL_STATE_CODE();
/* bdrv_open() defaults to the values in bdrv_flags (for compatibility
* with other callers) rather than what we want as the real defaults.
* Apply the defaults here instead. */
@@ -647,6 +649,7 @@ void blockdev_close_all_bdrv_states(void)
{
BlockDriverState *bs, *next_bs;
+ GLOBAL_STATE_CODE();
QTAILQ_FOREACH_SAFE(bs, &monitor_bdrv_states, monitor_list, next_bs) {
AioContext *ctx = bdrv_get_aio_context(bs);
@@ -2300,6 +2303,8 @@ void qmp_transaction(TransactionActionList *dev_list,
BlkActionState *state, *next;
Error *local_err = NULL;
+ GLOBAL_STATE_CODE();
+
QTAILQ_HEAD(, BlkActionState) snap_bdrv_states;
QTAILQ_INIT(&snap_bdrv_states);
@@ -3602,6 +3607,8 @@ void qmp_blockdev_del(const char *node_name, Error **errp)
AioContext *aio_context;
BlockDriverState *bs;
+ GLOBAL_STATE_CODE();
+
bs = bdrv_find_node(node_name);
if (!bs) {
error_setg(errp, "Failed to find node with node-name='%s'", node_name);