From nobody Sun Feb 8 23:06:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637677409; cv=none; d=zohomail.com; s=zohoarc; b=RMIFKrtW62v06Y1jVmMOVNKGxoDik++zY/qmg3plZZm8laO+JgFPTFm0Zs0c44ix51Fz3Ga6nIODZlfZqCcjSxnUpj/1yZKnJtvdJMmRiXoF17BBIrKplH0Bk0FPk/z7vHyHdEjFaBPoCx1AMoRUbhUY01nHrhKex1q5PxcY6PA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677409; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/qPj3r3ATbhBrjt5DYQdTEZcxsmTGA3qrooqmsBeKRM=; b=MOshinO9bkUlYDfzcJCFc+KkNh2hmHFB49Oe09jt3yXcA+jJqbCRs1uGuT3ZdTL+NJ+vVHWGsDlVrTyD6vbu1k+WlESNirNSfccuNwoI/UvG1bXT5NUfQGsBfeG8igSG4HVU+36CMsgWDIjkxAirjQ+anCx+My0sbQncqaRzF6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1637677409831299.3889546386681; Tue, 23 Nov 2021 06:23:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-564-Ceg7VqMoN5295mBKiKBHAQ-1; Tue, 23 Nov 2021 09:23:25 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AA0B1018720; Tue, 23 Nov 2021 14:23:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93CAF60862; Tue, 23 Nov 2021 14:23:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C8D5B4EA39; Tue, 23 Nov 2021 14:23:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ANENIIb032737 for ; Tue, 23 Nov 2021 09:23:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 33E3160CC4; Tue, 23 Nov 2021 14:23:18 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id A51D860CC3 for ; Tue, 23 Nov 2021 14:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677408; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/qPj3r3ATbhBrjt5DYQdTEZcxsmTGA3qrooqmsBeKRM=; b=BZlvIhnQEKnfU8paj3KVwgbKOKM40a/21kZkcA9RtgNaGrlklRUd06f7FallD2T661yJ8F mKA789ZnGnJKkJovXR0xsMqVaa0HvxWxog1QSs10OIZ8OIKRhNGk/OUmsKcqM2411vcU/X TCJFsFBMn9SxDB/xiJz57jNYE/h9k9I= X-MC-Unique: Ceg7VqMoN5295mBKiKBHAQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] qemu_monitor: remove unused load snapshot code Date: Tue, 23 Nov 2021 15:23:14 +0100 Message-Id: <4d9fdb18255d2081f8999e214bed3a3cae6386c9.1637677309.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637677410913100001 Content-Type: text/plain; charset="utf-8" Recent cleanup of snapshot revert code made these function unused. Signed-off-by: Pavel Hrdina --- 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 ch= ar *name) return qemuMonitorTextCreateSnapshot(mon, name); } =20 -int -qemuMonitorLoadSnapshot(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 qemuMonitorTextLoadSnapshot(mon, name); -} - =20 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); =20 int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name); -int qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name); int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name); =20 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; } =20 -int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name) -{ - g_autofree char *cmd =3D NULL; - g_autofree char *reply =3D NULL; - - cmd =3D 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 snaps= hots")); - return -1; - } else if (strstr(reply, "Could not find snapshot")) { - virReportError(VIR_ERR_OPERATION_INVALID, - _("the snapshot '%s' does not exist, and was not lo= aded"), - 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 =3D 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); =20 int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name); -int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name); int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name); --=20 2.31.1