}
-/* Use the snapshot_blkdev command to convert the existing file for
- * device into a read-only backing file of a new qcow2 image located
- * at file. */
-int
-qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
- const char *device, const char *file,
- const char *format, bool reuse)
-{
- VIR_DEBUG("actions=%p, device=%s, file=%s, format=%s, reuse=%d",
- actions, device, file, format, reuse);
-
- QEMU_CHECK_MONITOR(mon);
-
- return qemuMonitorJSONDiskSnapshot(mon, actions, device, file, format, reuse);
-}
-
-
/* Start a drive-mirror block job. bandwidth is in bytes/sec. */
int
qemuMonitorDriveMirror(qemuMonitorPtr mon,
int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name);
int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name);
-int qemuMonitorDiskSnapshot(qemuMonitorPtr mon,
- virJSONValuePtr actions,
- const char *device,
- const char *file,
- const char *format,
- bool reuse);
int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
ATTRIBUTE_NONNULL(2);
int qemuMonitorDriveMirror(qemuMonitorPtr mon,
}
-int
-qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
- const char *device, const char *file,
- const char *format, bool reuse)
-{
- int ret = -1;
- virJSONValuePtr cmd;
- virJSONValuePtr reply = NULL;
-
- cmd = qemuMonitorJSONMakeCommandRaw(actions != NULL,
- "blockdev-snapshot-sync",
- "s:device", device,
- "s:snapshot-file", file,
- "s:format", format,
- "S:mode", reuse ? "existing" : NULL,
- NULL);
- if (!cmd)
- return -1;
-
- if (actions) {
- if (virJSONValueArrayAppend(actions, cmd) == 0) {
- ret = 0;
- cmd = NULL;
- }
- } else {
- if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
- goto cleanup;
-
- ret = qemuMonitorJSONCheckError(cmd, reply);
- }
-
- cleanup:
- virJSONValueFree(cmd);
- virJSONValueFree(reply);
- return ret;
-}
-
/* speed is in bytes/sec */
int
qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
int qemuMonitorJSONDelObject(qemuMonitorPtr mon,
const char *objalias);
-int qemuMonitorJSONDiskSnapshot(qemuMonitorPtr mon,
- virJSONValuePtr actions,
- const char *device,
- const char *file,
- const char *format,
- bool reuse)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
- ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,