From nobody Thu Sep 19 01:10:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1721084907; cv=none; d=zohomail.com; s=zohoarc; b=mWnZKCuZGRMqhLvqKnqauykd316eP4qbLUa3sglsKi/TzmzYOC6xqifLWtIuEQzwUOEX41jv53JBtcbVX8TKPi3UfVYv24mpZdmdioaaRmu74QOMgO1yus0sRd9qeMCghhhi1DeqtlOH0bgndkcIX7VVUAJ+CmQMRmfycOEw6gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721084907; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=GwR0Vn3fOxQlTRO2AytkmfBeQSkmq07ncIR7n7X2tnw=; b=nNicEsGwsWPr5DYZB/gwaAisPf2q+4eVpTUMMJn769UQ/7cS3Ka8nHL3H9AwP4XbeRPnJiuB7V+8RVaR9eQ+Eby/45LRlkIkD0P1RFQ0Ej1qB3ilP7j/2bEppU5e/cnTKvgdPLW5eb3dagA8OsjShm8bYFCxaKH7bkGlgSsSqg4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1721084907873263.52900311150165; Mon, 15 Jul 2024 16:08:27 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 87726BFA; Mon, 15 Jul 2024 19:08:26 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id CC716A5E; Mon, 15 Jul 2024 19:07:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E4782A58; Mon, 15 Jul 2024 19:07:45 -0400 (EDT) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A243BA53 for ; Mon, 15 Jul 2024 19:07:44 -0400 (EDT) Received: from [130.117.225.1] (helo=vz9-barybin-2.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1sTUXj-00CvTw-2Z; Tue, 16 Jul 2024 00:52:20 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 950 seconds by postgrey-1.37 at lists.libvirt.org; Mon, 15 Jul 2024 19:07:44 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=1A5IIM0lB6owzwYAqWSEdyrXWQ9Silj5l/yGvD2UqUs=; b=voyyf0rlV+au vyXhAJRg3N872HJ5A59y41fhAtJ+ZH5yOs+Fd3T2UES0GCGSNNclnlaXhS9PeMT/mwOeIld8RPXjF HtK+B0+PrFnFSrFfZxAgS3kvk3EAH/EL+rQhmnYYqDbXNZb+tODgmgcBCPXjGRS8rLnf4DML6veJQ YBdyyd64b4dr1HORkeotwEGtCIhWFA1FDKeZ0z4cxz5Hd9DERyDdFitS6aLHACZ1Qv/qkSB3l98ay xlFHKyL6rbVJFovFs4k5oisDAJ0ol+jK/dXQ7SNv+0NjLFuBK7DMsO2xSflmBlN2m6FaVBm4WVd9q Drqqsxrbww90WrhFRFduFQ==; To: devel@lists.libvirt.org Subject: [PATCH 4/4] qemu monitor: reap qemu_monitor_text Date: Tue, 16 Jul 2024 01:42:28 +0300 Message-ID: <20240715225013.100847-6-nikolai.barybin@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240715225013.100847-2-nikolai.barybin@virtuozzo.com> References: <20240715225013.100847-2-nikolai.barybin@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VHMCI2GZLIDZMX5FKRZKU5KBNRFVR2MA X-Message-ID-Hash: VHMCI2GZLIDZMX5FKRZKU5KBNRFVR2MA X-MailFrom: nikolai.barybin@virtuozzo.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: den@openvz.org, Nikolai Barybin X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Nikolai Barybin via Devel Reply-To: Nikolai Barybin X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1721084910163116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolai Barybin --- 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 "" =20 -#: 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 "" =20 -#: 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 "" =20 -#: 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 =3D [ '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 @@ =20 #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, } =20 =20 -int -qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name) -{ - VIR_DEBUG("name=3D%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=3D%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); =20 -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 - * . - */ - -#include - - -#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 =3D NULL; - g_autofree char *reply =3D NULL; - - cmd =3D 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 snaps= hots")); - return -1; - } - - return 0; -} - -int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name) -{ - g_autofree char *cmd =3D NULL; - g_autofree char *reply =3D NULL; - - cmd =3D 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 sna= pshots")); - 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 - * . - */ - -#pragma once - -#include "internal.h" - -#include "qemu_monitor.h" - -int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name); -int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name); --=20 2.43.5