From nobody Tue Dec 16 16:40:57 2025 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=1743581469; cv=none; d=zohomail.com; s=zohoarc; b=OwSdVdEJThveRpueqPK2445WxgtS/G6ccxyiqJlZW9RiIdj+OzFoiqccmU83KiFjiuYtqr1PTSEM+bGoFgo6N+LFwx06YOY3+8qJGSgOMEn01C3Vod4R6AFZYAL8ThY8luo1MAYvK9Cn4iyX0N8ybnEvoAHpPwgI7Z1cDoSB0kM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743581469; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=qq0t04giLYKPoZRNQn93sZE5txNSWGQ3vCqwVV8xL1w=; b=aJCqHVVbJBMXrGCcgJOIDEm+phGsSR/Vn33eMHrsTeJB7bpQtl/xOvrl+tBnOI+9VDTiwA6Rip5caxqUfqRe52P5FdAtaXWPZiY+sNzkUfnsrKWPEyIMgynujUQIROLqQAESHkBtAwTVSjqm4jI0I0OGYTHJYP36kdKF6TReew8= 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 1743581469203981.9385739911577; Wed, 2 Apr 2025 01:11:09 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8FB3213F0; Wed, 2 Apr 2025 04:11:08 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 39558141C; Wed, 2 Apr 2025 04:09:00 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A5ABE1410; Wed, 2 Apr 2025 04:08:57 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3B0D4EA1 for ; Wed, 2 Apr 2025 04:08:41 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-e1G6ZJ-gOaupO8F1sm_sFA-1; Wed, 02 Apr 2025 04:08:39 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A143018001E2 for ; Wed, 2 Apr 2025 08:08:38 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D7A9B180A803 for ; Wed, 2 Apr 2025 08:08:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743581320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ri0OaQxbYdfSkUf05M4aajAPYdGoQ8gG1/6QxXi1Z6k=; b=bUBvpLFrdehEsTf5sUA3D6SXJR4WydBaV0K7s17Kfu/3FntnQyZBbDkskzrLtIdq3Jni8y cuuUyHU9zHdwWTLSJENQ+7xxx9FXmSfwedfLVeIkZGq/IW3GgAWt1W6rPLrN5ebHLnXjfb fZULhHf2EcMn+Vezp7QDeOgApaV6Fdg= X-MC-Unique: e1G6ZJ-gOaupO8F1sm_sFA-1 X-Mimecast-MFC-AGG-ID: e1G6ZJ-gOaupO8F1sm_sFA_1743581318 To: devel@lists.libvirt.org Subject: [PATCH 5/6] qemu: monitor: Remove HMP monitor code Date: Wed, 2 Apr 2025 10:08:28 +0200 Message-ID: <94a0008a1c7bb4bd5f57999f9f62b9891a1c4392.1743580869.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: i_zMFxAyiivhwXI_UPq_gbWfM5nV5jWwFQZa-CImVkg_1743581318 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HMD42IK57GDZ7MHG6GMNPBRD4MFV3BDD X-Message-ID-Hash: HMD42IK57GDZ7MHG6GMNPBRD4MFV3BDD X-MailFrom: pkrempa@redhat.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 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: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1743581469591019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Now that we've replaced the final two HMP commands used by libvirt we can fully drop the 'text' monitor support. The only thing we keep is the HMP passtrhough with 'virsh qemu-monitor-command'. Signed-off-by: Peter Krempa --- po/POTFILES | 1 - 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 ------------ 6 files changed, 147 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 0c83affb44..9747c38951 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -188,7 +188,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/src/qemu/meson.build b/src/qemu/meson.build index 7a07d4f2c4..5cf20f426f 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 fc215def13..6340f437dd 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" @@ -2745,30 +2744,6 @@ qemuMonitorDelObject(qemuMonitor *mon, } -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 9a55b49472..db451c448b 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -976,9 +976,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 - * . - */ - -#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.49.0