aboutsummaryrefslogtreecommitdiff
path: root/block/dmg.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/dmg.c')
-rw-r--r--block/dmg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/block/dmg.c b/block/dmg.c
index 27ce4a62d1..900ae5a678 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -419,8 +419,12 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
return -EINVAL;
}
+ ret = bdrv_set_read_only(bs, true, errp);
+ if (ret < 0) {
+ return ret;
+ }
+
block_module_load_one("dmg-bz2");
- bdrv_set_read_only(bs, true);
s->n_chunks = 0;
s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL;