mirror of https://gitee.com/openkylin/libvirt.git
qemu: monitor: Remove old external snapshot code
Remove the dual mode code which allowed to create snapshots without support for 'transaction'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bed681d7b5
commit
42f3bbb15e
|
@ -3203,23 +3203,6 @@ qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
|
|||
}
|
||||
|
||||
|
||||
/* 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,
|
||||
|
|
|
@ -839,12 +839,6 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name);
|
|||
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,
|
||||
|
|
|
@ -4112,43 +4112,6 @@ int qemuMonitorJSONDelObject(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,
|
||||
|
|
|
@ -242,14 +242,6 @@ int qemuMonitorJSONAddObject(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,
|
||||
|
|
Loading…
Reference in New Issue