From nobody Mon Feb 9 03:29:18 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=1658753137; cv=none; d=zohomail.com; s=zohoarc; b=aJ/pgTPmYSfB81xRKsnr9Tzg5sPXKwQFhxCHnDW8mQgyP1utU0I9XF5PToTtMkAJDnMTzxftvL+a98KWirK7CCjzJ7RwAYp4Vl2Ch+CSfAePuv5ht4vk/u59emr6ugMjv2w91qiUEGP0CBgae5MKolDrDRUwoaPZm0oXxPvC3Hs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753137; 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=UqAvLyQu2l58VdaZWdQSKI9xIQ6141kcQp4ng0Gf/rk=; b=SDp0Rk/kM8EUbFFk3E/TfeXuK5s6neq4Xr2bIiyr0AjcpLBAHfHPnQYdYnNRJjfYjihoPfO2Tm7rcUL9clY0q5S2ucYgS8bwnrnzDFcm/TDV+Q7NuJEqqpk2or5iURfUNU0BES0qb6wB781oEvw940BzSFPQA9hRxI/2iGaVbjo= 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 1658753137859437.1091594032389; Mon, 25 Jul 2022 05:45:37 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-Ibw537beMbmZfZcfzimG1w-1; Mon, 25 Jul 2022 08:45:32 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 491C4824079; Mon, 25 Jul 2022 12:45:29 +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 2EB7F492CA6; Mon, 25 Jul 2022 12:45:29 +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 C60DD1945D88; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A7491945D81 for ; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0AF41909FE; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 755D618EAA for ; Mon, 25 Jul 2022 12:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753136; 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=UqAvLyQu2l58VdaZWdQSKI9xIQ6141kcQp4ng0Gf/rk=; b=MWdk/hxzOvUvBDoOi2aAsbbjR9O446C/dcPxYD0vZnG8K+od1Pgd9HYLakx//Agi+POoPu rqizsD2+gUJVExxGigX+FTmc58sbYdkUzaeKNF5mNE+/kwGPaPBCp2nZVpyZX29MFs4SQH 9XZj+jpTVAgH8HJhlVPleYfw3Lwvy80= X-MC-Unique: Ibw537beMbmZfZcfzimG1w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/5] qemuMigrationDstPersist: Avoid multi-line ternary operator in function call Date: Mon, 25 Jul 2022 14:45:19 +0200 Message-Id: <0f7bcdeed7bcbec45f499d65c99004994997ea03.1658753062.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.9 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: 1658753139490100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 800f66349d..a14b774a22 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6393,6 +6393,7 @@ qemuMigrationDstPersist(virQEMUDriver *driver, g_autoptr(virDomainDef) oldDef =3D NULL; unsigned int oldPersist =3D vm->persistent; virObjectEvent *event; + virDomainEventDefinedDetailType eventDetail =3D VIR_DOMAIN_EVENT_DEFIN= ED_UPDATED; vm->persistent =3D 1; oldDef =3D vm->newDef; @@ -6402,18 +6403,19 @@ qemuMigrationDstPersist(virQEMUDriver *driver, priv->qemuCaps))) goto error; - if (!oldPersist && qemuDomainNamePathsCleanup(cfg, vmdef->name, false)= < 0) - goto error; + if (!oldPersist) { + eventDetail =3D VIR_DOMAIN_EVENT_DEFINED_ADDED; + + if (qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0) + goto error; + } if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 && !ignoreSaveError) goto error; - event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_DEFINED, - oldPersist ? - VIR_DOMAIN_EVENT_DEFINED_UPD= ATED : - VIR_DOMAIN_EVENT_DEFINED_ADD= ED); + event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFIN= ED, + eventDetail); virObjectEventStateQueue(driver->domainEventState, event); return 0; --=20 2.36.1