From nobody Sun Feb 8 20:13:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1637839008; cv=none; d=zohomail.com; s=zohoarc; b=DRZ8a2tT2lRLP0+hvUXOCM0ExtUu2lS/RnCSyfYq2FnbLM2jp26rCiIdMeDbvgDcVB/As3TDKOfy6B+jy650OSV61h787OJXrxTNRNJEzFxgl3j+E1rKY8p38JKHYaQ+9LZiVsj3TD/EYiM4KZlJ0mcA5Feae8sc5gL0C535D3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637839008; 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; bh=dLXw7EEpZcwX6BWAA3z6A8HkMgKl+ijz7ljcOp8pzHU=; b=CfztAULZznk3iYGzJDiFnbpNZajE2v7SfVjTN6dgSWINk39S6ERR+PqIIL2PBVwaHE0shDPD4bqB4zsPK4z8f1oUmmzF0ns/L3I/qQJLxTf69imZuNW0Wg5hsmSXSuwbLRQlN3OhUZeyYXnPj5AhFnmmSShpm3hxwyrpZJQpuio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163783900896385.67281496888825; Thu, 25 Nov 2021 03:16:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-WXi0-S9nO2iwFpTi6nLGoQ-1; Thu, 25 Nov 2021 06:16:44 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98BC8192D791; Thu, 25 Nov 2021 11:16:39 +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 7AFD95F4F7; Thu, 25 Nov 2021 11:16:39 +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 2864018077BC; Thu, 25 Nov 2021 11:16:39 +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 1APBGQAX022822 for ; Thu, 25 Nov 2021 06:16:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 110E11002390; Thu, 25 Nov 2021 11:16:26 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EEEF1000051 for ; Thu, 25 Nov 2021 11:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637839008; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dLXw7EEpZcwX6BWAA3z6A8HkMgKl+ijz7ljcOp8pzHU=; b=CmI1clDLAK39u56givnLr4fw4jAh2KpSAxaGTnzWAFpVnZ726s5OQ+EUiX66u/VCO/a780 c4rNbE0L+EdlHOs+jnivOY18CB3epGrlaNMRTij1N6+V32/kOZYD4nV3HkfR4aRsP4HM6g Tl+CXf15Mim2l6JZdf1mpXb9cejJXsY= X-MC-Unique: WXi0-S9nO2iwFpTi6nLGoQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 04/11] qemu_snapshot: create: move virDomainSnapshotAssignDef to both code paths Date: Thu, 25 Nov 2021 12:16:10 +0100 Message-Id: <0e22dd26ade18c144b517c69b0c5f254f0b4bb5f.1637838934.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637839011094100001 Content-Type: text/plain; charset="utf-8" This makes it obvious that the function is called for creating new snapshot and redefining old snapshot as well. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 7198a2aad3..6860133bbb 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1761,15 +1761,18 @@ qemuSnapshotCreateXML(virDomainPtr domain, driver->xmlopt, flags) < 0) goto endjob; + + if (!snap) { + if (!(snap =3D virDomainSnapshotAssignDef(vm->snapshots, def))) + goto endjob; + } } else { if (qemuSnapshotAlignDisks(vm, def, driver, flags) < 0) goto endjob; =20 if (qemuSnapshotPrepare(vm, def, &flags) < 0) goto endjob; - } =20 - if (!snap) { if (!(snap =3D virDomainSnapshotAssignDef(vm->snapshots, def))) goto endjob; =20 --=20 2.31.1