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