]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_monitor: remove unused load snapshot code
authorPavel Hrdina <phrdina@redhat.com>
Tue, 23 Nov 2021 13:50:20 +0000 (14:50 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 23 Nov 2021 15:03:07 +0000 (16:03 +0100)
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>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h

index ac988e063ba7ffc79819c327f5326d73188bf021..26b59801b88b48164f4d41c816d409af9f4a12de 100644 (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)
index 0dd7b1c4e266a70efa8180c530a3b945f1f49269..99ecebc64878bf4a97b03b1de1d78d8181ae5c25 100644 (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)
index 6a1a913055beff2df149c06abd02218580f4640c..0ca7f5a470b26efbf82807339f9de6a854a574e4 100644 (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;
index c8177d3b3bc058d7801872b3343b4f89dc10dce4..d959fc8889b9289454fda0c3fde8f7bc97d2ff65 100644 (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);