[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 28/31] block_int-common.h: assertions in the callers of BdrvCh
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v7 28/31] block_int-common.h: assertions in the callers of BdrvChildClass function pointers |
Date: |
Fri, 11 Feb 2022 09:51:50 -0500 |
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index d1f5cd2b39..4297431812 100644
--- a/block.c
+++ b/block.c
@@ -1497,7 +1497,7 @@ const BdrvChildClass child_of_bds = {
AioContext *bdrv_child_get_parent_aio_context(BdrvChild *c)
{
- IO_CODE();
+ GLOBAL_STATE_CODE();
return c->klass->get_parent_aio_context(c);
}
@@ -2128,6 +2128,7 @@ bool bdrv_is_writable(BlockDriverState *bs)
static char *bdrv_child_user_desc(BdrvChild *c)
{
+ GLOBAL_STATE_CODE();
return c->klass->get_parent_desc(c);
}
@@ -2844,6 +2845,7 @@ static void bdrv_replace_child_noperm(BdrvChild **childp,
assert(!child->frozen);
assert(old_bs != new_bs);
+ GLOBAL_STATE_CODE();
if (old_bs && new_bs) {
assert(bdrv_get_aio_context(old_bs) == bdrv_get_aio_context(new_bs));
@@ -2940,6 +2942,7 @@ static void bdrv_attach_child_common_abort(void *opaque)
BdrvChild *child = *s->child;
BlockDriverState *bs = child->bs;
+ GLOBAL_STATE_CODE();
/*
* Pass free_empty_child=false, because we still need the child
* for the AioContext operations on the parent below; those
@@ -3308,6 +3311,7 @@ void bdrv_unref_child(BlockDriverState *parent, BdrvChild
*child)
static void bdrv_parent_cb_change_media(BlockDriverState *bs, bool load)
{
BdrvChild *c;
+ GLOBAL_STATE_CODE();
QLIST_FOREACH(c, &bs->parents, next_parent) {
if (c->klass->change_media) {
c->klass->change_media(c, load);
@@ -3807,6 +3811,7 @@ static BlockDriverState *bdrv_open_inherit(const char
*filename,
assert(!child_class || !flags);
assert(!child_class == !parent);
+ GLOBAL_STATE_CODE();
if (reference) {
bool options_non_empty = options ? qdict_size(options) : false;
@@ -4193,6 +4198,7 @@ static BlockReopenQueue
*bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
* important to avoid graph changes between the recursive queuing here and
* bdrv_reopen_multiple(). */
assert(bs->quiesce_counter > 0);
+ GLOBAL_STATE_CODE();
if (bs_queue == NULL) {
bs_queue = g_new0(BlockReopenQueue, 1);
@@ -7327,6 +7333,7 @@ void bdrv_set_aio_context_ignore(BlockDriverState *bs,
BdrvChild *child, *parent;
g_assert(qemu_get_current_aio_context() == qemu_get_aio_context());
+ GLOBAL_STATE_CODE();
if (old_context == new_context) {
return;
@@ -7399,6 +7406,7 @@ void bdrv_set_aio_context_ignore(BlockDriverState *bs,
static bool bdrv_parent_can_set_aio_context(BdrvChild *c, AioContext *ctx,
GSList **ignore, Error **errp)
{
+ GLOBAL_STATE_CODE();
if (g_slist_find(*ignore, c)) {
return true;
}
--
2.31.1
- [PATCH v7 22/31] include/block/snapshot: global state API + assertions, (continued)
- [PATCH v7 22/31] include/block/snapshot: global state API + assertions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 20/31] include/sysemu/blockdev.h: global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 18/31] include/block/blockjob.h: global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 13/31] IO_CODE and IO_OR_GS_CODE for block_int I/O API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 10/31] block.c: assertions to the block layer permissions API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 08/31] block/block-backend.c: assertions for block-backend, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 09/31] IO_CODE and IO_OR_GS_CODE for block-backend I/O API, 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 27/31] block_int-common.h: split function pointers in BdrvChildClass, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 06/31] block/export/fuse.c: allow writable exports to take RESIZE permission, 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 <=
- [PATCH v7 05/31] IO_CODE and IO_OR_GS_CODE for block I/O API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 07/31] include/sysemu/block-backend: split header into I/O and global state (GS) API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 16/31] GS and IO CODE macros for blockjob_int.h, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 03/31] include/block/block: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 21/31] assertions for blockdev.h global state API, 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 23/31] block/copy-before-write.h: global state API + assertions, 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 26/31] block_int-common.h: assertions in the callers of BlockDriver function pointers, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 29/31] block-backend-common.h: split function pointers in BlockDevOps, Emanuele Giuseppe Esposito, 2022/02/11