@@ -880,6 +880,11 @@ static int bdrv_unlock_image(BlockDriverState *bs)
return bdrv_lock_unlock_image_do(bs, false);
}
+bool bdrv_image_locked(BlockDriverState *bs)
+{
+ return bs->image_locked;
+}
+
static QemuOptsList bdrv_runtime_opts = {
.name = "bdrv_common",
.head = QTAILQ_HEAD_INITIALIZER(bdrv_runtime_opts.head),
@@ -282,7 +282,7 @@ int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState *top,
BlockDriverState *bdrv_find_overlay(BlockDriverState *active,
BlockDriverState *bs);
BlockDriverState *bdrv_find_base(BlockDriverState *bs);
-
+bool bdrv_image_locked(BlockDriverState *bs);
typedef struct BdrvCheckResult {
int corruptions;
Signed-off-by: Fam Zheng <famz@redhat.com> --- block.c | 5 +++++ include/block/block.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)