From nobody Sat Feb 7 06:21:04 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 15459061446841004.7844114708696; Thu, 27 Dec 2018 02:22:24 -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 47A07DF88E; Thu, 27 Dec 2018 10:22:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0587D1057066; Thu, 27 Dec 2018 10:22:22 +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 A4F5D181BA17; Thu, 27 Dec 2018 10:22:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBRALmZd028163 for ; Thu, 27 Dec 2018 05:21:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 07E345C23C; Thu, 27 Dec 2018 10:21:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D19225C22C; Thu, 27 Dec 2018 10:21:44 +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 B17EE85363; Thu, 27 Dec 2018 10:21:42 +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 1gcSnM-0003jg-Jg; Thu, 27 Dec 2018 13:21:40 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 27 Dec 2018 13:20:46 +0300 Message-Id: <1545906052-101494-5-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.25]); Thu, 27 Dec 2018 10:21:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); 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.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/10] conf: snapshot: align exernal/internal snapshot the same way 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.38]); Thu, 27 Dec 2018 10:22:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In case !require_match (disk snapshots or snapshot with external memory) setting disk->snapshot if it is not set in snapshot definition is straigtforward. First check default value for the disk from domain definiti= on (disk_snapshot) and use it if it is set, second if it is not set then use default value provided as function argument. But require_match case is trickier. For some reason it reverts this logic except for the case when disk_snapshot is none. This logic added in commit [1]. AFAIU this is done because mixing internal and external disks snapshots is not supported (and still is). But then it is not clear why in case of disks snapshots (!require_match) the logic is not the same as for internal snapshots because mixing is not supported in both cases. Also it is seems very surprising that for some snapshots domain disks settings are respected and for others are n= ot. Making exception for none seems complicating things further. AFAIU this exception intention was to disable snapshots for readonly disks because for these disks disk_snapshot is set to none on parsing stage. I suggest to use same logic for require_match as for !require_match. This m= akes things graspable in respect to settings priorities coming from different pl= aces. And this breaks clients that set disks_snapshot to external and then makes internal snapshots. I hope this was not used by anyone. There are no other changes. This function is used on snapshot redefine too. I guess users are not supposed to remove snapshot attributes for disks from previously dumped snapshot xmls. [1] f9670b - snapshot: improve disk align checking Signed-off-by: Nikolay Shirokovskiy --- src/conf/snapshot_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index bd125dc..7d5367f 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -582,9 +582,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def, =20 disk_snapshot =3D def->dom->disks[idx]->snapshot; if (!disk->snapshot) { - if (disk_snapshot && - (!require_match || - disk_snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)) + if (disk_snapshot) disk->snapshot =3D disk_snapshot; else disk->snapshot =3D default_snapshot; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list