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:
Pavel Hrdina 2021-11-23 14:50:20 +01:00
parent 097296c30b
commit 4b3c0d1aba
4 changed files with 0 additions and 49 deletions

View File

@ -3016,17 +3016,6 @@ qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *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
qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name)

View File

@ -1057,7 +1057,6 @@ int qemuMonitorDriveDel(qemuMonitor *mon,
const char *drivestr);
int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name);
int qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name);
int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name);
int qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions)

View File

@ -144,42 +144,6 @@ qemuMonitorTextCreateSnapshot(qemuMonitor *mon,
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)
{
g_autofree char *cmd = NULL;

View File

@ -32,5 +32,4 @@ int qemuMonitorTextDriveDel(qemuMonitor *mon,
const char *drivestr);
int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name);
int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name);
int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name);