]> Git Repo - qemu.git/blobdiff - block/dmg.c
block: Attach bs->file only during .bdrv_open()
[qemu.git] / block / dmg.c
index 58a3ae86c1da77e8825efc0548fb3c44bc8ab07e..8e387cdfe5d08790efaf001b4e47b33e74e826f4 100644 (file)
@@ -413,6 +413,12 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
     int64_t offset;
     int ret;
 
+    bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+                               false, errp);
+    if (!bs->file) {
+        return -EINVAL;
+    }
+
     block_module_load_one("dmg-bz2");
     bs->read_only = true;
 
This page took 0.022416 seconds and 4 git commands to generate.