[libvirt PATCH 1/2] qemu_monitor: remove unused load snapshot code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Recent cleanup of snapshot revert code made these function unused.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.c      | 11 -----------
 src/qemu/qemu_monitor.h      |  1 -
 src/qemu/qemu_monitor_text.c | 36 ------------------------------------
 src/qemu/qemu_monitor_text.h |  1 -
 4 files changed, 49 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index ac988e063b..26b59801b8 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -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)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 0dd7b1c4e2..99ecebc648 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -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)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 6a1a913055..0ca7f5a470 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -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;
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index c8177d3b3b..d959fc8889 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -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);
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux