aboutsummaryrefslogtreecommitdiff
path: root/block/block-backend.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2022-03-03 10:15:57 -0500
committerKevin Wolf <kwolf@redhat.com>2022-03-04 18:18:25 +0100
commitb4ad82aab10ea0cfe981e94414751e26a510c280 (patch)
tree811923470433dcb7cc6279677b4f0f3b19271b38 /block/block-backend.c
parentebc2752b08ea238438a45666654cbecf78b021a3 (diff)
downloadqemu-b4ad82aab10ea0cfe981e94414751e26a510c280.zip
qemu-b4ad82aab10ea0cfe981e94414751e26a510c280.tar.gz
qemu-b4ad82aab10ea0cfe981e94414751e26a510c280.tar.bz2
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 'block/block-backend.c')
-rw-r--r--block/block-backend.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index be7adce..93dc5cd 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1106,6 +1106,7 @@ static void blk_root_change_media(BdrvChild *child, bool load)
*/
bool blk_dev_has_removable_media(BlockBackend *blk)
{
+ GLOBAL_STATE_CODE();
return !blk->dev || (blk->dev_ops && blk->dev_ops->change_media_cb);
}
@@ -1123,6 +1124,7 @@ bool blk_dev_has_tray(BlockBackend *blk)
*/
void blk_dev_eject_request(BlockBackend *blk, bool force)
{
+ GLOBAL_STATE_CODE();
if (blk->dev_ops && blk->dev_ops->eject_request_cb) {
blk->dev_ops->eject_request_cb(blk->dev_opaque, force);
}
@@ -1145,6 +1147,7 @@ bool blk_dev_is_tray_open(BlockBackend *blk)
*/
bool blk_dev_is_medium_locked(BlockBackend *blk)
{
+ GLOBAL_STATE_CODE();
if (blk->dev_ops && blk->dev_ops->is_medium_locked) {
return blk->dev_ops->is_medium_locked(blk->dev_opaque);
}