diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2022-03-03 10:16:08 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-03-04 18:18:25 +0100 |
commit | 377cc15bf1994a176162a5f705ff32a38aa55e2c (patch) | |
tree | 86d8de69cfbec24fb9e2fec764e2eebc09d30e53 /block | |
parent | 6b573efec853b84e99cae060dccc6d71e58af511 (diff) | |
download | qemu-377cc15bf1994a176162a5f705ff32a38aa55e2c.zip qemu-377cc15bf1994a176162a5f705ff32a38aa55e2c.tar.gz qemu-377cc15bf1994a176162a5f705ff32a38aa55e2c.tar.bz2 |
block/copy-before-write.h: global state API + assertions
copy-before-write functions always run under BQL.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-24-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/copy-before-write.c | 2 | ||||
-rw-r--r-- | block/copy-before-write.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/block/copy-before-write.c b/block/copy-before-write.c index c30a5ff..80b7684 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -223,6 +223,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source, QDict *opts; assert(source->total_sectors == target->total_sectors); + GLOBAL_STATE_CODE(); opts = qdict_new(); qdict_put_str(opts, "driver", "copy-before-write"); @@ -245,6 +246,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source, void bdrv_cbw_drop(BlockDriverState *bs) { + GLOBAL_STATE_CODE(); bdrv_drop_filter(bs, &error_abort); bdrv_unref(bs); } diff --git a/block/copy-before-write.h b/block/copy-before-write.h index 51847e7..6e72bb2 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -29,6 +29,13 @@ #include "block/block_int.h" #include "block/block-copy.h" +/* + * Global state (GS) API. These functions run under the BQL. + * + * See include/block/block-global-state.h for more information about + * the GS API. + */ + BlockDriverState *bdrv_cbw_append(BlockDriverState *source, BlockDriverState *target, const char *filter_node_name, |