]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/cloop.c
sheepdog: Don't truncate long VDI name in _open(), _create()
[mirror_qemu.git] / block / cloop.c
index 7b75f7ef7b63db60adb186c5ffe9b2e7c5ca01cc..a6c7b9dbe642c8d262a8ef5eac9ddad8d0c707de 100644 (file)
@@ -66,6 +66,12 @@ static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
     uint32_t offsets_size, max_compressed_block_size = 1, i;
     int ret;
 
+    bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+                               false, errp);
+    if (!bs->file) {
+        return -EINVAL;
+    }
+
     bs->read_only = true;
 
     /* read header */
@@ -284,6 +290,7 @@ static BlockDriver bdrv_cloop = {
     .instance_size  = sizeof(BDRVCloopState),
     .bdrv_probe     = cloop_probe,
     .bdrv_open      = cloop_open,
+    .bdrv_child_perm     = bdrv_format_default_perms,
     .bdrv_refresh_limits = cloop_refresh_limits,
     .bdrv_co_preadv = cloop_co_preadv,
     .bdrv_close     = cloop_close,