From nobody Tue Feb 10 10:59:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1646916057; cv=none; d=zohomail.com; s=zohoarc; b=CZ8ETCPhPbgNlxMTzUKi43MzDC4G3VJpUYdcB2l1BRyzWv920vrcb68Iluzm8V4oUK2C8L7x0khCn9t/e+0OenBSfKaQvfB+HSpZ8pAR+Xd/1IXm2GVXjvupuuMka4oesX1K478P90eH+BYjtH2lnovbLOUB7lk76FRVbAPDJ9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646916057; 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=ZJg9yVsKjp+k+A5IoVC+tWcIGU06x5DRDFH6K8xVMbs=; b=RcjjZEZfTEZcbrn+jLfLTEajp6N0kEHgiowuD5DmUwIoCZFmRnerEB7qQ+E04vuY3O+OzZ0E1zK3O3dqh0YUIup+007o13Pk/BryXcfQEBvbcXB6QG7ATGmX/sFKIo1p5idfX1t+pZbT61C0cH7vnbQScL7rgn3AZgFC/MY0oQQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1646916057228441.78641975419043; Thu, 10 Mar 2022 04:40:57 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-lYcuqaklMXqnERRZFFrgUQ-1; Thu, 10 Mar 2022 07:40:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9DF5438025F3; Thu, 10 Mar 2022 12:40:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86482141DC5F; Thu, 10 Mar 2022 12:40:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 34EA81953576; Thu, 10 Mar 2022 12:40:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 15034195FD67 for ; Thu, 10 Mar 2022 12:40:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C8BFB7D3CC; Thu, 10 Mar 2022 12:40:48 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE5F47D3CD for ; Thu, 10 Mar 2022 12:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646916056; 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=ZJg9yVsKjp+k+A5IoVC+tWcIGU06x5DRDFH6K8xVMbs=; b=ektS+q5/B1xgI2aZqLmxHrJwur+jpNDLSLRv5JaXFCnutOGHdhs1xYmudwbzQh/w0owiVc VtFTjKMRxgJtXnkUKFLiKQzDLe2uDWDNNxz7TpfpeC8GhObqFHsnVE4zNoVGhyCtnyBkS1 +uehcCbMmWHcLe+IGdktZIFMH28Lgng= X-MC-Unique: lYcuqaklMXqnERRZFFrgUQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/14] qemuSnapshotCreateAlignDisks: Rewrite logic for selecting default memory snapshot mode Date: Thu, 10 Mar 2022 13:40:31 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1646916058476100003 Content-Type: text/plain; charset="utf-8" Use an if/else branch rather than a expression with a ternary operator. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index f92b571b06..355a2fd782 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1672,9 +1672,10 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm, return -1; } - def->memory =3D (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_SHUTOFF ? - VIR_DOMAIN_SNAPSHOT_LOCATION_NONE : - VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL); + if (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_SHUTOFF) + def->memory =3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE; + else + def->memory =3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; } if (virDomainSnapshotAlignDisks(def, NULL, align_location, true) < 0) return -1; --=20 2.35.1