From nobody Sun May 5 20:05:58 2024 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 1544688299078671.6744467230118; Thu, 13 Dec 2018 00:04:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04A953154859; Thu, 13 Dec 2018 08:04:58 +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 C931325261; Thu, 13 Dec 2018 08:04:57 +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 81C9F181B9F6; Thu, 13 Dec 2018 08:04:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84Ui6009054 for ; Thu, 13 Dec 2018 03:04:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id D70896012C; Thu, 13 Dec 2018 08:04:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE93E600C5 for ; Thu, 13 Dec 2018 08:04:26 +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 15FBC307D840 for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyn-0002eM-R3 for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:21 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:51 +0300 Message-Id: <1544688239-814454-2-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.48]); Thu, 13 Dec 2018 08:04:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 13 Dec 2018 08:04:24 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/9] qemu: release job on cleanup path 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 13 Dec 2018 08:04:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduced-by: 6a6f6b91e qemu: "Fix CPU model broken by older libvirt" Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 90cbc02..3242a60 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16457,7 +16457,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, */ if (cookie && qemuDomainFixupCPUs(vm, &cookie->cpu) < 0) - goto cleanup; + goto endjob; =20 rc =3D qemuProcessStart(snapshot->domain->conn, driver, vm, cookie ? cookie->cpu : NULL, --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 154468829139786.1914592963019; Thu, 13 Dec 2018 00:04:51 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 1ABBB30020AE; Thu, 13 Dec 2018 08:04:50 +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 DC8AC17998; Thu, 13 Dec 2018 08:04:49 +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 9464A3F7D5; Thu, 13 Dec 2018 08:04:49 +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 wBD84S3b009005 for ; Thu, 13 Dec 2018 03:04:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 93EE83795; Thu, 13 Dec 2018 08:04:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BB695ED55 for ; Thu, 13 Dec 2018 08:04:26 +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 443A8F823 for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-0F for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:52 +0300 Message-Id: <1544688239-814454-3-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.28]); Thu, 13 Dec 2018 08:04:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 13 Dec 2018 08:04:24 +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.002 (RCVD_IN_MSPIKE_H2, 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.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/9] qemu: snapshot revert: reuse common cleanup code 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Dec 2018 08:04:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Commit [1] changed cleanup code to first remove inactive domain and then release job so we can reuse common cleanup code. [1] 9115dcd83 qemu: Introduce and use qemuDomainRemoveInactiveJob Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3242a60..f7c1d6f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16533,8 +16533,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, =20 if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) { qemuDomainRemoveInactive(driver, vm); - qemuProcessEndJob(driver, vm); - goto cleanup; + goto endjob; } if (config) virDomainObjAssignDef(vm, config, false, NULL); @@ -16554,8 +16553,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, virDomainAuditStart(vm, "from-snapshot", rc >=3D 0); if (rc < 0) { qemuDomainRemoveInactive(driver, vm); - qemuProcessEndJob(driver, vm); - goto cleanup; + goto endjob; } detail =3D VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT; event =3D virDomainEventLifecycleNewFromObj(vm, --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688296901489.65129711010275; Thu, 13 Dec 2018 00:04:56 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 74C729F742; Thu, 13 Dec 2018 08:04:55 +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 3E53660C6A; Thu, 13 Dec 2018 08:04:55 +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 EA940181B9EA; Thu, 13 Dec 2018 08:04:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84U2E009047 for ; Thu, 13 Dec 2018 03:04:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id A269F1057073; Thu, 13 Dec 2018 08:04:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B294105706A for ; Thu, 13 Dec 2018 08:04:26 +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 41A5D31256DA for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-3Q for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:53 +0300 Message-Id: <1544688239-814454-4-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.46]); Thu, 13 Dec 2018 08:04:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 13 Dec 2018 08:04:25 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/9] qemu: snapshot: save/restore inactive persistent config 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 13 Dec 2018 08:04:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In case of active persistent domain snapshot metadata is not complete. We save only active configuration and on restore use it both for active and inactive configuration. Let's fix it and save and restore both in this case. In case of active transient or inactive domain we have only one config and thus everything is good. By the way this patch fixes config memleak on error paths. Signed-off-by: Nikolay Shirokovskiy --- src/conf/snapshot_conf.c | 1 + src/conf/snapshot_conf.h | 2 ++ src/qemu/qemu_driver.c | 44 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 5a511b4..2e4a0b9 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -102,6 +102,7 @@ void virDomainSnapshotDefFree(virDomainSnapshotDefPtr d= ef) virDomainSnapshotDiskDefClear(&def->disks[i]); VIR_FREE(def->disks); virDomainDefFree(def->dom); + virDomainDefFree(def->persistDom); virObjectUnref(def->cookie); VIR_FREE(def); } diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 20a42bd..3da204a 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -75,6 +75,8 @@ struct _virDomainSnapshotDef { virDomainSnapshotDiskDef *disks; =20 virDomainDefPtr dom; + /* inactive domain config in case of active persistent domain */ + virDomainDefPtr persistDom; =20 virObjectPtr cookie; =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f7c1d6f..7e0585d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15687,6 +15687,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, VIR_DOMAIN_DEF_PARSE_SKIP= _VALIDATE))) goto endjob; =20 + if (virDomainObjIsActive(vm) && vm->persistent && + !(def->persistDom =3D qemuDomainDefCopy(driver, vm->newDef, + VIR_DOMAIN_XML_SECURE | + VIR_DOMAIN_XML_MIGRATABL= E))) + goto endjob; + if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) { align_location =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; align_match =3D false; @@ -16219,6 +16225,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, qemuDomainObjPrivatePtr priv; int rc; virDomainDefPtr config =3D NULL; + virDomainDefPtr persistConfig =3D NULL; virQEMUDriverConfigPtr cfg =3D NULL; virCapsPtr caps =3D NULL; bool was_stopped =3D false; @@ -16226,6 +16233,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, virCPUDefPtr origCPU =3D NULL; unsigned int start_flags =3D VIR_QEMU_PROCESS_START_GEN_VMID; qemuDomainAsyncJob jobType =3D QEMU_ASYNC_JOB_START; + virDomainDefPtr newConfig =3D NULL; =20 virCheckFlags(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED | @@ -16332,6 +16340,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, goto endjob; } =20 + if (snap->def->persistDom && + !(persistConfig =3D virDomainDefCopy(snap->def->persistDom, caps, + driver->xmlopt, NULL, true))) + goto endjob; + cookie =3D (qemuDomainSaveCookiePtr) snap->def->cookie; =20 switch ((virDomainState) snap->def->state) { @@ -16440,8 +16453,18 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, * failed loadvm attempt? */ goto endjob; } - if (config) { - virDomainObjAssignDef(vm, config, false, NULL); + + /* Older versions do not save inactive config in metadata, ins= tead + * they use active config for this purpose, so keep this behav= iour + * for backward compat. + */ + if (persistConfig) + VIR_STEAL_PTR(newConfig, persistConfig); + else + VIR_STEAL_PTR(newConfig, config); + + if (newConfig) { + virDomainObjAssignDef(vm, newConfig, false, NULL); virCPUDefFree(priv->origCPU); VIR_STEAL_PTR(priv->origCPU, origCPU); } @@ -16449,8 +16472,10 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, /* Transitions 2, 3 */ load: was_stopped =3D true; - if (config) + if (config) { virDomainObjAssignDef(vm, config, false, NULL); + config =3D NULL; + } =20 /* No cookie means libvirt which saved the domain was too old = to * mess up the CPU definitions. @@ -16471,6 +16496,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, detail); if (rc < 0) goto endjob; + + if (persistConfig) { + virDomainObjAssignDef(vm, persistConfig, false, NULL); + VIR_STEAL_PTR(newConfig, persistConfig); + } } =20 /* Touch up domain state. */ @@ -16535,8 +16565,10 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, qemuDomainRemoveInactive(driver, vm); goto endjob; } - if (config) + if (config) { virDomainObjAssignDef(vm, config, false, NULL); + VIR_STEAL_PTR(newConfig, config); + } =20 if (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)) { @@ -16600,7 +16632,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, } else if (snap) { snap->def->current =3D false; } - if (ret =3D=3D 0 && config && vm->persistent && + if (ret =3D=3D 0 && newConfig && vm->persistent && !(ret =3D virDomainSaveConfig(cfg->configDir, driver->caps, vm->newDef ? vm->newDef : vm->def))) { detail =3D VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT; @@ -16616,6 +16648,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, virObjectUnref(cfg); virNWFilterUnlockFilterUpdates(); virCPUDefFree(origCPU); + virDomainDefFree(config); + virDomainDefFree(persistConfig); =20 return ret; } --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688295621771.8337214917952; Thu, 13 Dec 2018 00:04:55 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 215897F3F1; Thu, 13 Dec 2018 08:04: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 E107160C6A; Thu, 13 Dec 2018 08:04:53 +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 9A5673F600; Thu, 13 Dec 2018 08:04:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84TWF009019 for ; Thu, 13 Dec 2018 03:04:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 11C551797C; Thu, 13 Dec 2018 08:04:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A48360A9C for ; Thu, 13 Dec 2018 08:04:26 +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 C23CC30BAB74 for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-6p for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:54 +0300 Message-Id: <1544688239-814454-5-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.47]); Thu, 13 Dec 2018 08:04:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 13 Dec 2018 08:04:25 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/9] schema: snapshot: add persistent domain config 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 13 Dec 2018 08:04:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- docs/schemas/domainsnapshot.rng | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/schemas/domainsnapshot.rng b/docs/schemas/domainsnapshot.= rng index 2680887..405e614 100644 --- a/docs/schemas/domainsnapshot.rng +++ b/docs/schemas/domainsnapshot.rng @@ -84,6 +84,16 @@ + + + + + + + + --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688287818899.0160364812347; Thu, 13 Dec 2018 00:04:47 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 4D61D3002E09; Thu, 13 Dec 2018 08:04:46 +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 121216012E; Thu, 13 Dec 2018 08:04: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 BEA73181B9F6; Thu, 13 Dec 2018 08:04:45 +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 wBD84Si8009006 for ; Thu, 13 Dec 2018 03:04:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 93A793794; Thu, 13 Dec 2018 08:04:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B6EE17D01 for ; Thu, 13 Dec 2018 08:04:26 +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 44549307D861 for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-Al for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:55 +0300 Message-Id: <1544688239-814454-6-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.48]); Thu, 13 Dec 2018 08:04:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 13 Dec 2018 08:04:25 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/9] conf: snapshot: dump/parse persistent domain config 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 13 Dec 2018 08:04:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Persistent in this case is a persistent config of active persistent domain. We need it for metadata to be complete as explained in previous patch. Config is saved like this: ... Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/conf/snapshot_conf.c | 26 +++++++ .../active_inactive_domain.xml | 85 ++++++++++++++++++= ++++ tests/domainsnapshotxml2xmltest.c | 1 + 3 files changed, 112 insertions(+) create mode 100644 tests/domainsnapshotxml2xmlout/active_inactive_domain.x= ml diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 2e4a0b9..34fcf64 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -283,6 +283,20 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, } else { VIR_WARN("parsing older snapshot that lacks domain"); } + + if (def->state =3D=3D VIR_DOMAIN_RUNNING || + def->state =3D=3D VIR_DOMAIN_PAUSED) { + int domainflags =3D VIR_DOMAIN_DEF_PARSE_INACTIVE | + VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; + xmlNodePtr domainNode; + + if ((domainNode =3D virXPathNode("./persistent/domain", ctxt))= && + !(def->persistDom =3D virDomainDefParseNode(ctxt->node->do= c, + domainNode, caps, + xmlopt, NULL, + domainflags))) + goto cleanup; + } } else { def->creationTime =3D tv.tv_sec; } @@ -753,6 +767,18 @@ virDomainSnapshotDefFormat(const char *domain_uuid, virBufferAddLit(&buf, "\n"); } =20 + if (def->persistDom) { + virBufferAddLit(&buf, "\n"); + virBufferAdjustIndent(&buf, 2); + + if (virDomainDefFormatInternal(def->persistDom, + caps, flags, &buf, xmlopt) < 0) + goto error; + + virBufferAdjustIndent(&buf, -2); + virBufferAddLit(&buf, "\n"); + } + if (virSaveCookieFormatBuf(&buf, def->cookie, virDomainXMLOptionGetSaveCookie(xmlopt)) < = 0) goto error; diff --git a/tests/domainsnapshotxml2xmlout/active_inactive_domain.xml b/te= sts/domainsnapshotxml2xmlout/active_inactive_domain.xml new file mode 100644 index 0000000..74025a3 --- /dev/null +++ b/tests/domainsnapshotxml2xmlout/active_inactive_domain.xml @@ -0,0 +1,85 @@ + + my snap name + !@#$%^ + running + + earlier_snap + + 1272917631 + + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + + 1 + diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xm= ltest.c index 2a07fe0..e51373d 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -204,6 +204,7 @@ mymain(void) DO_TEST_OUT("noparent", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false); DO_TEST_OUT("metadata", "c7a5fdbd-edaf-9455-926a-d65c16db1809", false); DO_TEST_OUT("external_vm_redefine", "c7a5fdbd-edaf-9455-926a-d65c16db1= 809", false); + DO_TEST_OUT("active_inactive_domain", NULL, true); =20 DO_TEST_INOUT("empty", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false, = false); DO_TEST_INOUT("noparent", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", fals= e, false); --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688287700415.8206147188889; Thu, 13 Dec 2018 00:04:47 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 4FDDF30012FE; Thu, 13 Dec 2018 08:04:46 +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 121A5608C6; Thu, 13 Dec 2018 08:04: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 C43AF181BA1A; Thu, 13 Dec 2018 08:04:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84XpY009065 for ; Thu, 13 Dec 2018 03:04:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 952351A933; Thu, 13 Dec 2018 08:04:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DFC61A930 for ; Thu, 13 Dec 2018 08:04:31 +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 11EA59FFFD for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-FX for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:56 +0300 Message-Id: <1544688239-814454-7-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.39]); Thu, 13 Dec 2018 08:04:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 13 Dec 2018 08:04:24 +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.002 (RCVD_IN_MSPIKE_H2, 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.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/9] docs: add persistent config to snapshot xml description 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Dec 2018 08:04:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolay Shirokovskiy --- docs/formatsnapshot.html.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/formatsnapshot.html.in b/docs/formatsnapshot.html.in index fbbecfd..1357f53 100644 --- a/docs/formatsnapshot.html.in +++ b/docs/formatsnapshot.html.in @@ -235,6 +235,13 @@ at the time of the snapshot (since 0.9.5). Readonly. +
persistent/domain
+
Inactive domain configuration for active persistent domain. + Such a domain have 2 distinct configs and here inactive is + stored. It is different from domain which more + presisely keeps "inactive portion" of active config. + (since 5.0.0). +
cookie
Save image cookie containing additional data libvirt may need to properly restore a domain from an active snapshot when such data --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688287659906.095498199008; Thu, 13 Dec 2018 00:04:47 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 728EAC04B2E4; Thu, 13 Dec 2018 08:04:46 +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 405D43843; Thu, 13 Dec 2018 08:04: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 B65E13F7D0; Thu, 13 Dec 2018 08:04:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84SGc009004 for ; Thu, 13 Dec 2018 03:04:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 936F65D717; Thu, 13 Dec 2018 08:04:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B7E35D6A9 for ; Thu, 13 Dec 2018 08:04:26 +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 BBA3FC058CBE for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-Kr for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:57 +0300 Message-Id: <1544688239-814454-8-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.32]); Thu, 13 Dec 2018 08:04:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Dec 2018 08:04:25 +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.002 (RCVD_IN_MSPIKE_H2, 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.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/9] conf: snapshot: check domain name on redefine 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Dec 2018 08:04:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Renaming domain which has snapshots is prohibited. Also reverting to ABI compatible active domain with a different name can have issues later I guess. So let's prohibit changing domain name on snapshot metadata redefine as well. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/conf/snapshot_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 34fcf64..fa1cd6b 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -1307,6 +1307,14 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, goto cleanup; } =20 + if (def->dom && + STRNEQ(def->dom->name, domain->name)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("definition for snapshot %s must use name %s"), + def->name, domain->name); + goto cleanup; + } + other =3D virDomainSnapshotFindByName(vm->snapshots, def->name); if (other) { if ((other->def->state =3D=3D VIR_DOMAIN_RUNNING || --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688275423663.0456444638684; Thu, 13 Dec 2018 00:04:35 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D3C3307DABB; Thu, 13 Dec 2018 08:04:33 +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 5968B3795; Thu, 13 Dec 2018 08:04:33 +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 09FD512E30; Thu, 13 Dec 2018 08:04:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84T7j009020 for ; Thu, 13 Dec 2018 03:04:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1217460D0B; Thu, 13 Dec 2018 08:04:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A272608C6 for ; Thu, 13 Dec 2018 08:04:26 +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 4614130B7A13 for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-Nd for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:58 +0300 Message-Id: <1544688239-814454-9-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.43]); Thu, 13 Dec 2018 08:04:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 13 Dec 2018 08:04:24 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/9] conf: snapshot: support persistent config on redefine 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 13 Dec 2018 08:04:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This patch just adds basic checks for persistent domain config on snapshot metadata redefine. It also lets use previous version of config if it exists in previous version of metadata and not explicitly specified in new one just as in case of top level config. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- src/conf/snapshot_conf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index fa1cd6b..b003a07 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -1315,6 +1315,22 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, goto cleanup; } =20 + if (def->persistDom && + memcmp(def->persistDom->uuid, domain->uuid, VIR_UUID_BUFLEN)) { + virReportError(VIR_ERR_INVALID_ARG, + _("persistent definition for snapshot %s must use u= uid %s"), + def->name, uuidstr); + goto cleanup; + } + + if (def->persistDom && + STRNEQ(def->persistDom->name, domain->name)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("persistent definition for snapshot %s must use n= ame %s"), + def->name, domain->name); + goto cleanup; + } + other =3D virDomainSnapshotFindByName(vm->snapshots, def->name); if (other) { if ((other->def->state =3D=3D VIR_DOMAIN_RUNNING || @@ -1349,6 +1365,11 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, } } =20 + if (other->def->persistDom && !def->persistDom) { + def->persistDom =3D other->def->persistDom; + other->def->persistDom =3D NULL; + } + if (def->dom) { if (def->state =3D=3D VIR_DOMAIN_DISK_SNAPSHOT || virDomainSnapshotDefIsExternal(def)) { @@ -1363,6 +1384,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain, other->def->dom =3D def->dom; def->dom =3D NULL; } + if (def->persistDom && !other->def->persistDom) { + other->def->persistDom =3D def->persistDom; + def->persistDom =3D NULL; + } goto cleanup; } } --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 20:05:58 2024 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 1544688273683539.9056505298425; Thu, 13 Dec 2018 00:04:33 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 515B8C058CBA; Thu, 13 Dec 2018 08:04:32 +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 D705460C64; Thu, 13 Dec 2018 08:04: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 4B8AC181B9E5; Thu, 13 Dec 2018 08:04:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBD84SnR008994 for ; Thu, 13 Dec 2018 03:04:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7D0806012C; Thu, 13 Dec 2018 08:04:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75F246012B for ; Thu, 13 Dec 2018 08:04:26 +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 6C40A30023ED for ; Thu, 13 Dec 2018 08:04:24 +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 1gXLyo-0002eM-R9 for libvir-list@redhat.com; Thu, 13 Dec 2018 11:04:22 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 13 Dec 2018 11:03:59 +0300 Message-Id: <1544688239-814454-10-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1544688239-814454-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1544688239-814454-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.44]); Thu, 13 Dec 2018 08:04:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Dec 2018 08:04:24 +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.002 (RCVD_IN_MSPIKE_H2, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 9/9] news: add notice for persistent config in snapshot 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Dec 2018 08:04:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolay Shirokovskiy Reviewed-by: John Ferlan --- docs/news.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a599ff4..79ebce9 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -52,6 +52,17 @@
+ qemu: snapshot inactive config of active persistent domain too + + + Previous libvirt versions do not store complete metadata for act= ive + persistent domain snapshot. As a result on revert both active and + inactive configs are reverted to be the same. Now snapshot saves= both + active and inactive configs. + + + + qemu: Add support for ARMv6l guests --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list