From nobody Mon Feb 9 03:58:22 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=1637838996; cv=none; d=zohomail.com; s=zohoarc; b=jfW+yOPoUJclFwBlFYyQJwiOU9/DQT20bPoo26osP1ivRSpx7c8Yz0pIND4gl1DPzQhxUqG4Biyfel4aTFiDPxrZT6Ev+FMyUDQrYZTKByqQT4qGN3RL6+d3myZqzkvI0hZ/yqTsa9zKy/gmObOaptPEZ6kjvOahtOXQWngciyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637838996; 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=eqQhCYav57j7S2MvL/lro3in9skw/GLZys6NxVu68Ns=; b=ArHkJF3drVUS5juLccpiW/oRpTEkKfkgGrsfZ+p7kQcBJssbt71dm0GAk2/zun9RVMhRXBVR/12MagNSu5W3ulrSNi8FDJEBfe24m8do8f/6OObiuwflWwOFOVAejrJ5ExgPlF3HtKrP9VnSG4KRy0FrZMbuZ3dhnR0s+4H9XoI= 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 1637838996889830.595270219591; Thu, 25 Nov 2021 03:16:36 -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-598-6q4nH7-BMeOWlNFMM0l69A-1; Thu, 25 Nov 2021 06:16:34 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 750C42F20; Thu, 25 Nov 2021 11:16:29 +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 2D28D1000051; Thu, 25 Nov 2021 11:16:29 +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 027FC1809CB8; Thu, 25 Nov 2021 11:16:29 +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 1APBGQda022834 for ; Thu, 25 Nov 2021 06:16:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id E9F931002390; 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 6696E1000051 for ; Thu, 25 Nov 2021 11:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637838995; 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=eqQhCYav57j7S2MvL/lro3in9skw/GLZys6NxVu68Ns=; b=XvMZ8Ik+3weg+A7i0vT8iqo/J4bX2q6qKYWpwQZ0ZaLG9LL7BBsF1dV2eofLNlw2vpYOZ7 ROhv0DGIXyJS2NhEXAJcnsH+dn00fuwbFfYj55FA/AnrcpTnpB8lY85yT+E2EEvcImnaQ9 8Bt3VAfMV9soj4J3KhnVZsta0WJBr/E= X-MC-Unique: 6q4nH7-BMeOWlNFMM0l69A-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 05/11] qemu_snapshot: create: virDomainSnapshotGetCurrent is not used with redefine Date: Thu, 25 Nov 2021 12:16:11 +0100 Message-Id: <9592831c17cd325c8932729e6a094c9f823089ee.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.84 on 10.5.11.22 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: 1637838997245100003 Content-Type: text/plain; charset="utf-8" Move it to code path for creating new snapshot. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 6860133bbb..9a3f90e346 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1703,7 +1703,6 @@ qemuSnapshotCreateXML(virDomainPtr domain, virQEMUDriver *driver =3D domain->conn->privateData; virDomainMomentObj *snap =3D NULL; virDomainSnapshotPtr snapshot =3D NULL; - virDomainMomentObj *current =3D NULL; bool update_current =3D true; bool redefine =3D flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); @@ -1767,6 +1766,8 @@ qemuSnapshotCreateXML(virDomainPtr domain, goto endjob; } } else { + virDomainMomentObj *current =3D NULL; + if (qemuSnapshotAlignDisks(vm, def, driver, flags) < 0) goto endjob; =20 @@ -1777,12 +1778,11 @@ qemuSnapshotCreateXML(virDomainPtr domain, goto endjob; =20 def =3D NULL; - } =20 - current =3D virDomainSnapshotGetCurrent(vm->snapshots); - if (current) { - if (!redefine) + current =3D virDomainSnapshotGetCurrent(vm->snapshots); + if (current) { snap->def->parent_name =3D g_strdup(current->def->name); + } } =20 /* actually do the snapshot */ --=20 2.31.1