if (vshCommandOptBool(cmd, "prealloc-metadata"))
flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
+
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
if (vshCommandOptBool(cmd, "prealloc-metadata"))
flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
+
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
.type = VSH_OT_BOOL,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
+ {.name = "reflink",
+ .type = VSH_OT_BOOL,
+ .help = N_("use btrfs COW lightweight copy")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "prealloc-metadata"))
flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
+ if (vshCommandOptBool(cmd, "reflink"))
+ flags |= VIR_STORAGE_VOL_CREATE_REFLINK;
+
if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
goto cleanup;
.type = VSH_OT_BOOL,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
+ {.name = "reflink",
+ .type = VSH_OT_BOOL,
+ .help = N_("use btrfs COW lightweight copy")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "prealloc-metadata"))
flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
+ if (vshCommandOptBool(cmd, "reflink"))
+ flags |= VIR_STORAGE_VOL_CREATE_REFLINK;
+
origpool = virStoragePoolLookupByVolume(origvol);
if (!origpool) {
vshError(ctl, "%s", _("failed to get parent pool"));
=item B<vol-create-from> I<pool-or-uuid> I<FILE> [I<--inputpool>
I<pool-or-uuid>] I<vol-name-or-key-or-path> [I<--prealloc-metadata>]
+[I<--reflink>]
Create a volume, using another volume as input.
I<pool-or-uuid> is the name or UUID of the storage pool to create the volume in.
support full allocation). This option creates a sparse image file with metadata,
resulting in higher performance compared to images with no preallocation and
only slightly higher initial disk space usage.
+When I<--reflink> is specified, perform a COW lightweight copy,
+where the data blocks are copied only when modified.
+If this is not possible, the copy fails.
=item B<vol-create-as> I<pool-or-uuid> I<name> I<capacity>
[I<--allocation> I<size>] [I<--format> I<string>] [I<--backing-vol>
only slightly higher initial disk space usage.
=item B<vol-clone> [I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
-I<name> [I<--prealloc-metadata>]
+I<name> [I<--prealloc-metadata>] [I<--reflink>]
Clone an existing volume. Less powerful, but easier to type, version of
B<vol-create-from>.
support full allocation). This option creates a sparse image file with metadata,
resulting in higher performance compared to images with no preallocation and
only slightly higher initial disk space usage.
+When I<--reflink> is specified, perform a COW lightweight copy,
+where the data blocks are copied only when modified.
+If this is not possible, the copy fails.
=item B<vol-delete> [I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>