From nobody Sun Feb 8 18:10:45 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=1637839006; cv=none; d=zohomail.com; s=zohoarc; b=j4IneF9g4vYzgmzY5jbgsNd91VUzBmWksthCJ/uhYb7W3xqj1XQ04yA7n0prS5mmUde7s2Lk35gTbEuwmbmh21nW7WWaG9772Gsm7YvXFREYWndrasUf15QwScECHRXCvYHZn49AOn7Q2xTkErCBWYgcnx4AYD+fMNPjMsCRo58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637839006; 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=wO/8VPbvmB5+pEzAFiRitl0XGfUY34xVPy+iSebzOYc=; b=OEWtM4jMVSPJLwpTHp8sGOEKhPcYYy8TJlSeWtiWYoJnUf6T4fXUxNmw20OJFAXgbI+npil9BTwGBKgEBhGJ4SlywLqi90vwnpDN/aGuyWp/GsxlpOmv7lWFTeopnbwrB/+5ODIdo4qQMllW/eAKz9K2687nmEz33LKTPYhTkOo= 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 1637839006459801.5727326630717; Thu, 25 Nov 2021 03:16:46 -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-136-WEfGGvhONx2rS0nYC2Webg-1; Thu, 25 Nov 2021 06:16:41 -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 BD8FC192D796; Thu, 25 Nov 2021 11:16:36 +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 A1D721037F3C; Thu, 25 Nov 2021 11:16:36 +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 704DF4CA9B; Thu, 25 Nov 2021 11:16:36 +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 1APBGUD6022856 for ; Thu, 25 Nov 2021 06:16:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7DBC61000051; Thu, 25 Nov 2021 11:16:30 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED2371002390 for ; Thu, 25 Nov 2021 11:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637839005; 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=wO/8VPbvmB5+pEzAFiRitl0XGfUY34xVPy+iSebzOYc=; b=jK0QrN3gCS1qqlP+8fgSOJS52k0JNVoMMRTDtRdthSMi8tzaEcXc364GxHl9tzaeDhvbPv i3oyjF2zrdZt+GQQDBJFjEZXM9zZGi5pnaMgq15D2L+9Dpm//lqRF4b+RB5Os+zOZ/CQAq MXv84uoTgsb38nHSBWFQwxIDr1Bj3tk= X-MC-Unique: WEfGGvhONx2rS0nYC2Webg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 06/11] qemu_snapshot: create: drop update_current variable Date: Thu, 25 Nov 2021 12:16:12 +0100 Message-Id: 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: 1637839006780100003 Content-Type: text/plain; charset="utf-8" There is no need for the extra variable as it is used only at one place. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 9a3f90e346..ac57d4e90e 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; - bool update_current =3D true; bool redefine =3D flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); g_autoptr(virDomainSnapshotDef) def =3D NULL; @@ -1726,10 +1725,6 @@ qemuSnapshotCreateXML(virDomainPtr domain, VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE, NULL); =20 - if ((redefine && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) || - (flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) - update_current =3D false; - if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) return NULL; =20 @@ -1824,7 +1819,7 @@ qemuSnapshotCreateXML(virDomainPtr domain, =20 endjob: if (snapshot && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) { - if (update_current) + if (!redefine || (flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) qemuSnapshotSetCurrent(vm, snap); =20 if (qemuDomainSnapshotWriteMetadata(vm, snap, --=20 2.31.1