mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu_monitor: remove unused load snapshot code
Recent cleanup of snapshot revert code made these function unused. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
097296c30b
commit
4b3c0d1aba
@ -3016,17 +3016,6 @@ qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name)
|
|||||||
return qemuMonitorTextCreateSnapshot(mon, name);
|
return qemuMonitorTextCreateSnapshot(mon, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name)
|
|
||||||
{
|
|
||||||
VIR_DEBUG("name=%s", name);
|
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR(mon);
|
|
||||||
|
|
||||||
/* there won't ever be a direct QMP replacement for this function */
|
|
||||||
return qemuMonitorTextLoadSnapshot(mon, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name)
|
qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name)
|
||||||
|
@ -1057,7 +1057,6 @@ int qemuMonitorDriveDel(qemuMonitor *mon,
|
|||||||
const char *drivestr);
|
const char *drivestr);
|
||||||
|
|
||||||
int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name);
|
int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name);
|
||||||
int qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name);
|
|
||||||
int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name);
|
int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name);
|
||||||
|
|
||||||
int qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions)
|
int qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions)
|
||||||
|
@ -144,42 +144,6 @@ qemuMonitorTextCreateSnapshot(qemuMonitor *mon,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name)
|
|
||||||
{
|
|
||||||
g_autofree char *cmd = NULL;
|
|
||||||
g_autofree char *reply = NULL;
|
|
||||||
|
|
||||||
cmd = g_strdup_printf("loadvm \"%s\"", name);
|
|
||||||
|
|
||||||
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (strstr(reply, "No block device supports snapshots")) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
||||||
_("this domain does not have a device to load snapshots"));
|
|
||||||
return -1;
|
|
||||||
} else if (strstr(reply, "Could not find snapshot")) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
|
||||||
_("the snapshot '%s' does not exist, and was not loaded"),
|
|
||||||
name);
|
|
||||||
return -1;
|
|
||||||
} else if (strstr(reply, "Snapshots not supported on device")) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
|
||||||
_("Failed to load snapshot: %s"), reply);
|
|
||||||
return -1;
|
|
||||||
} else if (strstr(reply, "Could not open VM state file") ||
|
|
||||||
strstr(reply, "Error: ") ||
|
|
||||||
(strstr(reply, "Error") &&
|
|
||||||
(strstr(reply, "while loading VM state") ||
|
|
||||||
strstr(reply, "while activating snapshot on")))) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
|
||||||
_("Failed to load snapshot: %s"), reply);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name)
|
int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name)
|
||||||
{
|
{
|
||||||
g_autofree char *cmd = NULL;
|
g_autofree char *cmd = NULL;
|
||||||
|
@ -32,5 +32,4 @@ int qemuMonitorTextDriveDel(qemuMonitor *mon,
|
|||||||
const char *drivestr);
|
const char *drivestr);
|
||||||
|
|
||||||
int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name);
|
int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name);
|
||||||
int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name);
|
|
||||||
int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name);
|
int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name);
|
||||||
|
Loading…
Reference in New Issue
Block a user