From nobody Sat Feb 7 09:29:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1545906153666790.9408437894411; Thu, 27 Dec 2018 02:22:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF6FBC0BEAA5; Thu, 27 Dec 2018 10:22:31 +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 B77461057068; Thu, 27 Dec 2018 10:22:31 +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 6BD283F60D; Thu, 27 Dec 2018 10:22:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBRALnO6028180 for ; Thu, 27 Dec 2018 05:21:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 076C25DD63; Thu, 27 Dec 2018 10:21:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 38D845DAA0; Thu, 27 Dec 2018 10:21:45 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3673E3C2CF5; Thu, 27 Dec 2018 10:21:43 +0000 (UTC) Received: from [10.94.3.220] (helo=dim-vz7.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gcSnN-0003jg-J9; Thu, 27 Dec 2018 13:21:41 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 27 Dec 2018 13:20:52 +0300 Message-Id: <1545906052-101494-11-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1545906052-101494-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1545906052-101494-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 27 Dec 2018 10:21:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 27 Dec 2018 10:21:43 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/10] conf: snapshot: make disk aligns same on redefinition 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 27 Dec 2018 10:22:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This patch is similar to [1] but reason is different. At time [1] was writt= en there is a check in virDomainSnapshotAlignDisks (it is removed in [2]) that won't allow external disks of external snapshot because of wrong align_loca= tion VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL. Now this check is gone. In case of disk snapshot and external snapshots we always dumped disks (see= [3] were at that time libvirt only makes active disk only snapshots, active internal snaphots and inactive internal snapshots. Then after the patch we start to dump disks snapshot section for all snapshots and before we do only active disk only snapshots). So if user's edits to dumped snapshots before redefine is limited then we don't need actually to call align for external cases. But's lets leave it for the case and then make disk align same wheth= er snapshot is redefined first time or not. [1] 731a5a4 - snapshot: qemu: Allow redefinition of external snapshots [2] --- * - conf: snapshot: remove snapshot mode checking from disk align [3] 4201a7e - snapshot: new XML for external system checkpoint * not yet pushed upstream (part of current patch series) Signed-off-by: Nikolay Shirokovskiy --- src/conf/snapshot_conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 172dff8..3033827 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -1307,6 +1307,8 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, } =20 if (def->dom) { + /* we can skip align in this cases as well as we always + * dumped disks for these cases */ if (def->state =3D=3D VIR_DOMAIN_DISK_SNAPSHOT || virDomainSnapshotDefIsExternal(def)) align_location =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; @@ -1335,8 +1337,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, *snap =3D other; } else { if (def->dom) { + /* we can skip align in this cases as well as we always + * dumped disks for these cases */ if (def->state =3D=3D VIR_DOMAIN_DISK_SNAPSHOT || - def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) + virDomainSnapshotDefIsExternal(def)) align_location =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; =20 if (virDomainSnapshotAlignDisks(def, align_location) < 0) --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list