[libvirt] [PATCHv2 08/15] blockjob: expose qemu commands for mirrored storage migration
Paolo Bonzini
pbonzini at redhat.com
Fri Apr 6 07:13:17 UTC 2012
Il 06/04/2012 06:36, Eric Blake ha scritto:
> +int
> +qemuMonitorJSONDriveMirror(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
> + virJSONValuePtr actions,
> + const char *device, const char *file,
> + const char *format, int mode)
> +{
> + int ret = -1;
> + virJSONValuePtr cmd;
> +
> + cmd = qemuMonitorJSONMakeCommandRaw(true,
> + "drive-mirror",
> + "s:device", device,
> + "s:target", file,
> + "s:format", format,
> + "s:mode",
> + qemuMonitorDriveMirrorTypeToString(mode),
> + NULL);
> + if (!cmd)
> + return -1;
> +
> + if (virJSONValueArrayAppend(actions, cmd) < 0) {
> + virReportOOMError();
> + goto cleanup;
> + }
Here it would be nice to invoke the command directly if actions is NULL.
Right now there is no certainty that drive-mirror will be
transactionable in upstream QEMU, so it is safer to invoke it outside a
transaction in patch 11.
Paolo
More information about the libvir-list
mailing list