From nobody Wed May 1 21:21:39 2024 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 Reviewed-by: J=C3=A1n Tomko --- 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 From nobody Wed May 1 21:21:39 2024 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=1637677422; cv=none; d=zohomail.com; s=zohoarc; b=XnIWazW+frMeOvvyEmPeWAVtzp1mA893laxrxQmEpA0mWhO6eN07fxDOLqzWgkzSlwsaYh6GLRL4suSdfFgu4TUKDrGwt1WA339NZ/RWUTE9dzxj3RaHN/QC6p8VpSVTnhmjKEeRlKRqCyhU207J8xlItFYs5RKOESysKbFf5LY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677422; 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=wMjgCG6idmx7F6U8l8ihD8OS20gMdEL1MaHL/gYIAVA=; b=Hjl7A57nK1jIjD+kQ+ZPIxAJbp46y8Evpm8HcDJPJzZzQPXcRybOwLwkn/b/2kh4Aod2jA5YT0EsKnUSob1EsT2C2LYm0/PSLzdOR/cF5kYSUWe/LqcvtaRYw33xtZe6Vnr+i9FGZAoaciCeK6A6dxFQlvnhXnNLofKy5deglhA= 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 1637677422375561.0762215550668; Tue, 23 Nov 2021 06:23:42 -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-592-ihIM0UjXMrq-eUuGdb3LQw-1; Tue, 23 Nov 2021 09:23:34 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBB778066EC; Tue, 23 Nov 2021 14:23:28 +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 BE1AE60CC3; Tue, 23 Nov 2021 14:23:28 +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 8C9EE4EA3E; Tue, 23 Nov 2021 14:23:28 +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 1ANENJva032742 for ; Tue, 23 Nov 2021 09:23:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1641D60C5F; Tue, 23 Nov 2021 14:23:19 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8895460CC3 for ; Tue, 23 Nov 2021 14:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677421; 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=wMjgCG6idmx7F6U8l8ihD8OS20gMdEL1MaHL/gYIAVA=; b=CgBSmfZjv9DhXk8bmBbkShIlRnTxztXJCu+arulqhFKtSifeppU2Ox7sB5YPpMSKl7ZNTf 9x4xjv8CgPcEZa9jsComsAIkwN7COq3o6Cejo6R/szhr7I+78xKEwlb5UmH/m2rAJ2yaKl UcfiR7HeTdSklApM24OjHyZZ/5tcPis= X-MC-Unique: ihIM0UjXMrq-eUuGdb3LQw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] virsh: man: update snapshot-revert description Date: Tue, 23 Nov 2021 15:23:15 +0100 Message-Id: <41623037f7495f7ed571c90b74b85338a17ceedc.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.12 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: 1637677424014100001 Content-Type: text/plain; charset="utf-8" We've changed the behavior of this API that from now on it will always restart the VM process and we are no longer able to revert to snapshots created by libvirt older then 0.9.5. Signed-off-by: Pavel Hrdina Reviewed-by: J=C3=A1n Tomko --- docs/manpages/virsh.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5f5ccfeafe..39636a565e 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -7293,6 +7293,10 @@ no vm state leaves the domain in an inactive state. = Passing either the transient domains cannot be inactive, it is required to use one of these flags when reverting to a disk snapshot of a transient domain. =20 +Since libvirt 7.10.0 the VM process is always restarted so the following +paragraph is no longer valid. If the snapshot metadata lacks the full +VM XML it's no longer possible to revert to such snapshot. + There are a number of cases where a snapshot revert involves extra risk, w= hich requires the use of *--force* to proceed: =20 --=20 2.31.1