From nobody Sun May 5 13:27:49 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569854577; cv=none; d=zoho.com; s=zohoarc; b=iMclDpsW0NiVd+/Q3HdwfrnsCXfZMTlU3mWKbjB+sGaxixv41diu599z1RYr7HggnlxiDJK2dFkVtQoSbrnLYWn/hTuzxpKWI6pMnW/LkBgh0mKe9EHFzyKcHf2LeXFhBjZow4E5DAZdbQWFKKH0tPUbnuvF6fBE3HBcu+ts+Vo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569854577; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=uQzGA594MsBXeHCRCborVVOGoGd1kgdZa7kabfMGkjk=; b=Q2HfZGHNqK64apG7NiNub8jDdh10CSmnpgXMR7yEmlGIH1EZKkzKcR+njKXnLrvYayUIapuR4IG9idjCUSIQTe1ks5fzzU4foEOwK5sAzRDt3DgZqSyWwpiljs1gGBb/dRq06Uu/HR1FPn2qU+Zcye2utfz6NL5w3Pwt2JVGsZY= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569854577802458.56786897090274; Mon, 30 Sep 2019 07:42:57 -0700 (PDT) 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 C8E2F1057878; Mon, 30 Sep 2019 14:42: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 390081001B22; Mon, 30 Sep 2019 14:42: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 1A8971803518; Mon, 30 Sep 2019 14:42:53 +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 x8UEgpFO016497 for ; Mon, 30 Sep 2019 10:42:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 06C055C223; Mon, 30 Sep 2019 14:42:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 832AD5C219 for ; Mon, 30 Sep 2019 14:42:50 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 30 Sep 2019 16:42:45 +0200 Message-Id: <36fd8ba4c88b15a242ecf987c7022be39e42e5e9.1569854528.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: snapshot: Don't update current snapshot until we're done 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: , 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.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 30 Sep 2019 14:42:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since commit f105627992e we store whether a snapshot is current globally rather than locally in the snapshot object. This means that we don't have to unset the current snapshot prior to taking/reverting the snapshot and we can do it only when everything is done tsuccessfully. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8751145ea0..95fe844c34 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16001,13 +16001,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (!redefine && VIR_STRDUP(snap->def->parent_name, current->def->name) < 0) goto endjob; - if (update_current) { - virDomainSnapshotSetCurrent(vm->snapshots, NULL); - if (qemuDomainSnapshotWriteMetadata(vm, current, - driver->caps, driver->xmlo= pt, - cfg->snapshotDir) < 0) - goto endjob; - } } /* actually do the snapshot */ @@ -16480,7 +16473,6 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, virDomainObjPtr vm =3D NULL; int ret =3D -1; virDomainMomentObjPtr snap =3D NULL; - virDomainMomentObjPtr current =3D NULL; virDomainSnapshotDefPtr snapdef; virObjectEventPtr event =3D NULL; virObjectEventPtr event2 =3D NULL; @@ -16580,17 +16572,6 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, } } - current =3D virDomainSnapshotGetCurrent(vm->snapshots); - if (current) { - virDomainSnapshotSetCurrent(vm->snapshots, NULL); - if (qemuDomainSnapshotWriteMetadata(vm, current, - driver->caps, driver->xmlopt, - cfg->snapshotDir) < 0) - goto endjob; - /* XXX Should we restore the current snapshot after this point - * in the failure cases where we know there was no change? */ - } - if (snap->def->dom) { config =3D virDomainDefCopy(snap->def->dom, caps, driver->xmlopt, priv->qemuCaps, true); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 13:27:49 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569854600; cv=none; d=zoho.com; s=zohoarc; b=MXFlTD4+RFatPlhxJKzYTsaoAqLc6uu0rBA6JLo1LvgXZqx9A8I0t942PgecQi1W3foGW+QQ525UCm9dhIcehz6ZdaPPx5jvoEJzLqzdqNYooewDkNdR5Ip9d27VKG+9x1PSSV5ESlpmHVPdj3V/WnrUUM9DxmuYvhzYxvam2M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569854600; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=HJe/dbEMugNiD+pF2GVfnioxdfcmrnAH0Yqp743KhTM=; b=EVW/gqy/EHU0lTVjYmcGriLPFSBPc1DbU0ozWqWD/yH3FzYusMGzx9erINMx+5poAkvJydNqCyTZ7DuUMMhrL7ALeNcy7I71OlSnAWGjJy1yWp4ei7fVKHDnrvQ9+1reNBhcWddqMsOE8ygBxfPWFwi3FE6sLjLZ3aQrgu3hbDk= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569854600612701.1071281390917; Mon, 30 Sep 2019 07:43:20 -0700 (PDT) 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 EA609302C066; Mon, 30 Sep 2019 14:43:18 +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 C2BC95C219; Mon, 30 Sep 2019 14:43:18 +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 7F9CA4E589; Mon, 30 Sep 2019 14:43:18 +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 x8UEgpMl016506 for ; Mon, 30 Sep 2019 10:42:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id C9EA25C223; Mon, 30 Sep 2019 14:42:51 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 533895C219 for ; Mon, 30 Sep 2019 14:42:51 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 30 Sep 2019 16:42:46 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: checkpoint: Don't update current checkpoint until we are done 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: , 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.46]); Mon, 30 Sep 2019 14:43:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Similarly to the snapshot code there's no reason to modify current checkpoint until we are done creating the new one. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_checkpoint.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 0d90bbec14..8856a90ce8 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -412,13 +412,6 @@ qemuCheckpointCreateXML(virDomainPtr domain, if (!redefine && VIR_STRDUP(chk->def->parent_name, other->def->name) < 0) goto endjob; - if (update_current) { - virDomainCheckpointSetCurrent(vm->checkpoints, NULL); - if (qemuCheckpointWriteMetadata(vm, other, - driver->caps, driver->xmlopt, - cfg->checkpointDir) < 0) - goto endjob; - } } /* actually do the checkpoint */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list