Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
::
vol-clone vol-name-or-key-or-path name
- [--pool pool-or-uuid] [--prealloc-metadata] [--reflink]
+ [--pool pool-or-uuid] [--prealloc-metadata] [--reflink] [--print-xml]
Clone an existing volume within the parent pool. Less powerful,
but easier to type, version of ``vol-create-from``.
where the data blocks are copied only when modified.
If this is not possible, the copy fails.
+If *--print-xml* is specified, then the XML used to clone the volume is
+printed instead.
+
vol-delete
----------
.type = VSH_OT_BOOL,
.help = N_("use btrfs COW lightweight copy")
},
+ {.name = "print-xml",
+ .type = VSH_OT_BOOL,
+ .help = N_("print XML document rather than clone the volume")
+ },
{.name = NULL}
};
return false;
}
+ if (vshCommandOptBool(cmd, "print-xml")) {
+ vshPrint(ctl, "%s", newxml);
+ return true;
+ }
+
if (!(newvol = virStorageVolCreateXMLFrom(origpool, (char *) newxml,
origvol, flags))) {
vshError(ctl, _("Failed to clone vol from %s"),