[--shallow] [--reuse-external] [bandwidth]
[--wait [--async] [--verbose]] [{--pivot | --finish}]
[--timeout seconds] [granularity] [buf-size] [--bytes]
- [--transient-job] [--synchronous-writes]
+ [--transient-job] [--synchronous-writes] [--print-xml]
Copy a disk backing image chain to a destination. Either *dest* as
the destination file name, or *--xml* with the name of an XML file containing
so that it's guaranteed that the job converges if the destination storage is
slower. This may impact performance of writes while the blockjob is running.
+If *--print-xml* is specified, then the XML used to start the block copy job
+is printed instead of starting the job.
blockjob
--------
.type = VSH_OT_BOOL,
.help = N_("the copy job forces guest writes to be synchronously written to the destination")
},
+ {.name = "print-xml",
+ .type = VSH_OT_BOOL,
+ .help = N_("print the XML used to start the copy job instead of starting the job")
+ },
{.name = NULL}
};
int abort_flags = 0;
const char *xml = NULL;
char *xmlstr = NULL;
+ bool print_xml = vshCommandOptBool(cmd, "print-xml");
virTypedParameterPtr params = NULL;
virshBlockJobWaitData *bjWait = NULL;
int nparams = 0;
}
if (granularity || buf_size || (format && STRNEQ(format, "raw")) || xml ||
- transientjob || syncWrites) {
+ transientjob || syncWrites || print_xml) {
/* New API */
if (bandwidth || granularity || buf_size) {
params = g_new0(virTypedParameter, 3);
xmlstr = virBufferContentAndReset(&buf);
}
+ if (print_xml) {
+ vshPrint(ctl, "%s", xmlstr);
+ ret = true;
+ goto cleanup;
+ }
+
if (virDomainBlockCopy(dom, path, xmlstr, params, nparams, flags) < 0)
goto cleanup;
} else {