[PATCH 4/4] qemu monitor: reap qemu_monitor_text

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

 



Signed-off-by: Nikolai Barybin <nikolai.barybin@xxxxxxxxxxxxx>
---
 po/POTFILES                  |  1 -
 po/libvirt.pot               | 18 --------
 src/qemu/meson.build         |  1 -
 src/qemu/qemu_monitor.c      | 25 ----------
 src/qemu/qemu_monitor.h      |  3 --
 src/qemu/qemu_monitor_text.c | 88 ------------------------------------
 src/qemu/qemu_monitor_text.h | 29 ------------
 7 files changed, 165 deletions(-)
 delete mode 100644 src/qemu/qemu_monitor_text.c
 delete mode 100644 src/qemu/qemu_monitor_text.h

diff --git a/po/POTFILES b/po/POTFILES
index 1ed4086d2c..28773c6d78 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -185,7 +185,6 @@ src/qemu/qemu_migration_cookie.c
 src/qemu/qemu_migration_params.c
 src/qemu/qemu_monitor.c
 src/qemu/qemu_monitor_json.c
-src/qemu/qemu_monitor_text.c
 src/qemu/qemu_namespace.c
 src/qemu/qemu_nbdkit.c
 src/qemu/qemu_passt.c
diff --git a/po/libvirt.pot b/po/libvirt.pot
index 30f9344015..15c0871352 100644
--- a/po/libvirt.pot
+++ b/po/libvirt.pot
@@ -8794,11 +8794,6 @@ msgstr ""
 msgid "Failed to delete snapshot %1$s"
 msgstr ""
 
-#: src/qemu/qemu_monitor_text.c:83
-#, c-format
-msgid "Failed to delete snapshot: %1$s"
-msgstr ""
-
 #: src/bhyve/bhyve_driver.c:389 src/libxl/libxl_driver.c:4670
 #: src/lxc/lxc_driver.c:2495 src/network/bridge_driver.c:3618
 #: src/qemu/qemu_driver.c:7793 src/storage/storage_driver.c:1399
@@ -10640,11 +10635,6 @@ msgstr ""
 msgid "Failed to symlink device %1$s to %2$s"
 msgstr ""
 
-#: src/qemu/qemu_monitor_text.c:52
-#, c-format
-msgid "Failed to take snapshot: %1$s"
-msgstr ""
-
 #: src/util/virprocess.c:424 src/util/virprocess.c:435
 #, c-format
 msgid "Failed to terminate process %1$lld with SIG%2$s"
@@ -44930,14 +44920,6 @@ msgstr ""
 msgid "this disk doesn't support update"
 msgstr ""
 
-#: src/qemu/qemu_monitor_text.c:74
-msgid "this domain does not have a device to delete snapshots"
-msgstr ""
-
-#: src/qemu/qemu_monitor_text.c:56
-msgid "this domain does not have a device to take snapshots"
-msgstr ""
-
 #: src/util/virerror.c:1042
 msgid "this domain exists already"
 msgstr ""
diff --git a/src/qemu/meson.build b/src/qemu/meson.build
index 57356451e4..ec0572fdeb 100644
--- a/src/qemu/meson.build
+++ b/src/qemu/meson.build
@@ -27,7 +27,6 @@ qemu_driver_sources = [
   'qemu_migration_params.c',
   'qemu_monitor.c',
   'qemu_monitor_json.c',
-  'qemu_monitor_text.c',
   'qemu_namespace.c',
   'qemu_nbdkit.c',
   'qemu_passt.c',
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 53f5ecf223..ccd937361c 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -28,7 +28,6 @@
 
 #include "qemu_alias.h"
 #include "qemu_monitor.h"
-#include "qemu_monitor_text.h"
 #include "qemu_monitor_json.h"
 #include "qemu_domain.h"
 #include "qemu_capabilities.h"
@@ -2739,30 +2738,6 @@ qemuMonitorDelObject(qemuMonitor *mon,
 }
 
 
-int
-qemuMonitorCreateSnapshot(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 qemuMonitorTextCreateSnapshot(mon, name);
-}
-
-
-int
-qemuMonitorDeleteSnapshot(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 qemuMonitorTextDeleteSnapshot(mon, name);
-}
-
-
 int
 qemuMonitorSnapshotSave(qemuMonitor *mon,
                         const char *jobname,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 27dbb78e06..7c9f014b61 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -960,9 +960,6 @@ int qemuMonitorDelObject(qemuMonitor *mon,
                          const char *objalias,
                          bool report_error);
 
-int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name);
-int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name);
-
 int qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions)
     ATTRIBUTE_NONNULL(2);
 int qemuMonitorBlockdevMirror(qemuMonitor *mon,
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
deleted file mode 100644
index 3482972600..0000000000
--- a/src/qemu/qemu_monitor_text.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * qemu_monitor_text.c: interaction with QEMU monitor console
- *
- * Copyright (C) 2006-2014 Red Hat, Inc.
- * Copyright (C) 2006 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-
-
-#include "qemu_monitor_text.h"
-#include "qemu_monitor_json.h"
-#include "virlog.h"
-#include "virerror.h"
-
-#define VIR_FROM_THIS VIR_FROM_QEMU
-
-VIR_LOG_INIT("qemu.qemu_monitor_text");
-
-int
-qemuMonitorTextCreateSnapshot(qemuMonitor *mon,
-                              const char *name)
-{
-    g_autofree char *cmd = NULL;
-    g_autofree char *reply = NULL;
-
-    cmd = g_strdup_printf("savevm \"%s\"", name);
-
-    if (qemuMonitorJSONHumanCommand(mon, cmd, -1, &reply))
-        return -1;
-
-    if (strstr(reply, "Error while creating snapshot") ||
-        strstr(reply, "Could not open VM state file") ||
-        strstr(reply, "State blocked by non-migratable device") ||
-        strstr(reply, "Error: ") ||
-        (strstr(reply, "Error") && strstr(reply, "while writing VM"))) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("Failed to take snapshot: %1$s"), reply);
-        return -1;
-    } else if (strstr(reply, "No block device can accept snapshots")) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("this domain does not have a device to take snapshots"));
-        return -1;
-    }
-
-    return 0;
-}
-
-int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name)
-{
-    g_autofree char *cmd = NULL;
-    g_autofree char *reply = NULL;
-
-    cmd = g_strdup_printf("delvm \"%s\"", name);
-    if (qemuMonitorJSONHumanCommand(mon, cmd, -1, &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 delete snapshots"));
-        return -1;
-    } else if (strstr(reply, "Snapshots not supported on device")) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
-        return -1;
-    } else if (strstr(reply, "Error: ") ||
-               (strstr(reply, "Error") &&
-                strstr(reply, "while deleting snapshot"))) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("Failed to delete snapshot: %1$s"), reply);
-        return -1;
-    }
-
-    return 0;
-}
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
deleted file mode 100644
index 27d0f061d3..0000000000
--- a/src/qemu/qemu_monitor_text.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * qemu_monitor_text.h: interaction with QEMU monitor console
- *
- * Copyright (C) 2006-2009, 2011-2012 Red Hat, Inc.
- * Copyright (C) 2006 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include "internal.h"
-
-#include "qemu_monitor.h"
-
-int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name);
-int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name);
-- 
2.43.5



[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