summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorJeff Cody2017-04-07 22:55:29 +0200
committerJeff Cody2017-04-24 21:09:33 +0200
commit45803a039670cbee914dcb54cf3952f9b2d64d1f (patch)
treee7b00a02d73fc7aca6093f17ab2afa834b197ace /include/block
parentblock: code movement (diff)
downloadqemu-45803a039670cbee914dcb54cf3952f9b2d64d1f.tar.gz
qemu-45803a039670cbee914dcb54cf3952f9b2d64d1f.tar.xz
qemu-45803a039670cbee914dcb54cf3952f9b2d64d1f.zip
block: introduce bdrv_can_set_read_only()
Introduce check function for setting read_only flags. Will return < 0 on error, with appropriate Error value set. Does not alter any flags. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: e2bba34ac3bc76a0c42adc390413f358ae0566e8.1491597120.git.jcody@redhat.com
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 1d7fd19b86..144df0ddfb 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -434,6 +434,7 @@ int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base,
int64_t sector_num, int nb_sectors, int *pnum);
bool bdrv_is_read_only(BlockDriverState *bs);
+int bdrv_can_set_read_only(BlockDriverState *bs, bool read_only, Error **errp);
int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp);
bool bdrv_is_sg(BlockDriverState *bs);
bool bdrv_is_inserted(BlockDriverState *bs);