From nobody Mon Feb 9 09:10:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578077035; cv=none; d=zohomail.com; s=zohoarc; b=hiVIUWiIGV5UeEUKtdlFZJGJCGZVzUPCKrrFG6VPT9efpkqkztuoxSqsyJWUtVFdQrUkYlxuW/pcSL0hpRuO4H5bKX3qRZrU4RhCyH33tp9U7yXmHo0tsdxjwEF9fer/4iOQ4Xi2CQAeWD9kAy8zytaRWlKCjVgq+9CRH27ml2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578077035; h=Content-Type:Content-Transfer-Encoding:Cc: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=JTn0w+Xt/dhRyXHq30VVFSv11NAtyoRpGQa/yzKUu6w=; b=jE8BQtMhgcIsAF/xWlXpvyZM4NxV07vLOul2aZRcNoYKRmFjgafJMfKQ/I0b+uVF0pPKkeMS1jJw+hRW+p5RUX7BnGC/iygJ5MOdrayDU40RLVx5bsNSdI6YobSGMmhlZGyyxK9oh66t27QcY9auBL8zlvpuHP2YtEotoiDcpgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578077035748560.9196198929711; Fri, 3 Jan 2020 10:43:55 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-rmSGsai4OBSns6Sf5ze0mA-1; Fri, 03 Jan 2020 13:43:52 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DED78024D2; Fri, 3 Jan 2020 18:43:47 +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 EA7747D963; Fri, 3 Jan 2020 18:43:46 +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 A6D6A81E37; Fri, 3 Jan 2020 18:43:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 003IhiOa021062 for ; Fri, 3 Jan 2020 13:43:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 410B710A58DA; Fri, 3 Jan 2020 18:43:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C16E10A58DD for ; Fri, 3 Jan 2020 18:43:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 513D9802A43 for ; Fri, 3 Jan 2020 18:43:42 +0000 (UTC) Received: from heinz.dinsnail.net (heinz.dinsnail.net [81.169.187.250]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-PwKiOkHKNjmsLON6JeRCcQ-1; Fri, 03 Jan 2020 13:43:38 -0500 Received: from heinz.dinsnail.net ([IPv6:0:0:0:0:0:0:0:1]) by heinz.dinsnail.net (8.15.2/8.15.2) with ESMTP id 003IhSHc015793; Fri, 3 Jan 2020 19:43:28 +0100 Received: (from michael@localhost) by heinz.dinsnail.net (8.15.2/8.15.2/Submit) id 003IhRbe015792; Fri, 3 Jan 2020 19:43:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578077034; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=JTn0w+Xt/dhRyXHq30VVFSv11NAtyoRpGQa/yzKUu6w=; b=OJzkwzFMdcgJ9+C0kw5gvvx6HC4sapu1qNVauhfKWadeRc2vgZDgdyDkcBmdvUkoAR7d1Q Y6TVdKXugUdgNiWdJzMQ/Qe1M+OHivvNmftsTmArpImvjkSSwAdKrztMAWUHFnREQ4wybf 24A3AH9QKntP5RBHmhJIeccnNxunbRw= From: Michael Weiser To: libvir-list@redhat.com Date: Fri, 3 Jan 2020 19:43:23 +0100 Message-Id: <20200103184325.5593-2-michael.weiser@gmx.de> In-Reply-To: <20200103184325.5593-1-michael.weiser@gmx.de> References: <20200103184325.5593-1-michael.weiser@gmx.de> MIME-Version: 1.0 X-dinsnail-net-MailScanner-Information: Please contact the ISP for more information X-dinsnail-net-MailScanner-ID: 003IhSHc015793 X-dinsnail-net-MailScanner: Found to be clean X-dinsnail-net-MailScanner-From: michael@heinz.dinsnail.net X-Spam-Status: No X-MC-Unique: PwKiOkHKNjmsLON6JeRCcQ-1 X-MC-Unique: rmSGsai4OBSns6Sf5ze0mA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 003IhiOa021062 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , Michael Weiser , Cole Robinson Subject: [libvirt] [PATCH v3 1/3] qemu: Warn of restore with managed save being risky 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.11 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Internal snapshots of a non-running domain do not carry any memory state and restoring such a snapshot will not replace existing saved memory state. This allows a scenario, where a user first suspends a domain into managedsave, restores a non-running snapshot and then resumes the domain from managedsave. After that, the guest system will run with its previous memory state atop a different disk state. The most obvious possible fallout from this is extensive file system corruption. Swap content and RAID bitmaps might also be off. This has been discussed[1] and fixed[2] from the end-user perspective for virt-manager. This patch marks the restore operation as risky at the libvirt level, requiring the user to remove the saved memory state first or force the operation. [1] https://www.redhat.com/archives/virt-tools-list/2019-November/msg00011.= html [2] https://www.redhat.com/archives/virt-tools-list/2019-December/msg00049.= html Signed-off-by: Michael Weiser Reviewed-by: Daniel Henrique Barboza Cc: Cole Robinson --- src/qemu/qemu_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ec8faf384c..691a9b45c7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16652,6 +16652,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, _("must respawn qemu to start inactive snapshot= ")); goto endjob; } + if (vm->hasManagedSave && + !(snapdef->state =3D=3D VIR_DOMAIN_SNAPSHOT_RUNNING || + snapdef->state =3D=3D VIR_DOMAIN_SNAPSHOT_PAUSED)) { + virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", + _("snapshot without memory state, removal of " + "existing managed saved state strongly " + "recommended to avoid corruption")); + goto endjob; + } } =20 if (snap->def->dom) { --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list