From nobody Mon May 6 08:55:03 2024 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=1577732525; cv=none; d=zohomail.com; s=zohoarc; b=hNB9urNuSrTrMWPzuS3lMKPe/Rpj2C2Ug7r+WSN6kUOJTTPWHMNFhkfnm3pyu6xZCn7QVnNT/h8DFaIf5bEH6KKsm5o9PNJzNxAc2CDqcrtD8y5QWS3IFJQllcT4X5sG2coRK3KKseWfjdB/IowgLbx94DnAr4QxN0lJb413HTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577732525; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=D3xqSBxV/JNrVKCPFqQRJeJ9rtEmpj45iDTasOuN1iE=; b=bFqOsPk8Hc6yaqWQZaY25QPmCpvg9SVwKqFwdIJKaoTrv0fLHPVwt89h8kARVNkaKy5xpit0pwvMtbu3oUa6DIbPcDv3qFo869ZmmXDSrACzb42q3BFmaDfvgFJsZFchbI5K7JCUN5C/wHmOv8B66mQoVcPjN9tJPdYo+MIGCSI= 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 1577732525558242.07989605506805; Mon, 30 Dec 2019 11:02:05 -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-228-jf1B9v1GNG-6XsBZed3nEg-1; Mon, 30 Dec 2019 14:02:00 -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 19767DB21; Mon, 30 Dec 2019 19:01:54 +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 25D5260BE1; Mon, 30 Dec 2019 19:01:51 +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 C6AE7819D8; Mon, 30 Dec 2019 19:01:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBUJ1gXc005194 for ; Mon, 30 Dec 2019 14:01:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4123A2093CC1; Mon, 30 Dec 2019 19:01:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C2D82026D67 for ; Mon, 30 Dec 2019 19:01:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 AFECA8D7732 for ; Mon, 30 Dec 2019 19:01:39 +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-QFVZBrdLOp2ia8-M3PCi4Q-1; Mon, 30 Dec 2019 14:01:37 -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 xBUI7d4C018629; Mon, 30 Dec 2019 19:07:39 +0100 Received: (from michael@localhost) by heinz.dinsnail.net (8.15.2/8.15.2/Submit) id xBUI7dXO018628; Mon, 30 Dec 2019 19:07:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577732523; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=D3xqSBxV/JNrVKCPFqQRJeJ9rtEmpj45iDTasOuN1iE=; b=aWEYYiLYea/w3G6bBBn2ZLF87m3FfXuKLJE5p6Z5/6XLzK0pyEhdJ612bBobsYMI1hliVy 98qsXMcheHIICnAyLf67Ordy90bKyyOG4pTtjg8pUIaNBS0ODZFhSWYoqPirFrNESvnO22 K4ZyjtwIwfpAvMPYobHVVXp2lePZ7t0= From: Michael Weiser To: libvir-list@redhat.com Date: Mon, 30 Dec 2019 19:07:36 +0100 Message-Id: <20191230180736.3203497-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: xBUI7d4C018629 X-dinsnail-net-MailScanner: Found to be clean X-dinsnail-net-MailScanner-From: michael@heinz.dinsnail.net X-Spam-Status: No X-MC-Unique: QFVZBrdLOp2ia8-M3PCi4Q-1 X-MC-Unique: jf1B9v1GNG-6XsBZed3nEg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id xBUJ1gXc005194 X-loop: libvir-list@redhat.com Cc: Michael Weiser , Cole Robinson Subject: [libvirt] [PATCH] 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.12 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 Cc: Cole Robinson Reviewed-by: Daniel Henrique Barboza --- 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..dcd103d3bb 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", + _("revert to snapshot while there is a managed " + "saved state will cause corruption when run, " + "remove saved state first")); + 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