From nobody Sun Feb 8 09:37:49 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=1658322786; cv=none; d=zohomail.com; s=zohoarc; b=AowMlZdmtp3vtkX7Wdek9p7e4KHJc1I2/ef76o/ZgDtn94GB4KzWTXtMqO/It6z/9ospdBSWj1fbgHv5XrJ+1ACGRSOD5lOefuG63iXa47QuexQpyxwdiRKWc1OOGNPzpF9AzrqiDq7HNWd43LaM9dE1KPYcaC8yEl+iUG9CIgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322786; 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=tXSHC97f5EkxarXcAQLl4G4irdfAL16ak/LfaNxqIac=; b=KDvfnEmXoZBKXUuWInpEqly4HrWDrUzyeV+XCI4FvJGGtLV2MeHdvdO7OJqrRWa2ot8SdGvrGvjaSlgoZZ2sUXycZjFLyKw7WjMg5hTDhpsdHDftKoqYrrTB/Ge2ZNE8E4O19ZXUq/I99nlSFBS4JwATOoMkVsQsrwAIRoMT3Bc= 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 1658322786541779.3940691344918; Wed, 20 Jul 2022 06:13:06 -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-589-0Gx-2BYsNBucSwbFQRxSRg-1; Wed, 20 Jul 2022 09:13:02 -0400 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 76B928001EA; Wed, 20 Jul 2022 13:12:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F2DF141511A; Wed, 20 Jul 2022 13:12:59 +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 E100B1947074; Wed, 20 Jul 2022 13:12:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD66D1947066 for ; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 90C4840D2853; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BE5840D282F for ; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322785; 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=tXSHC97f5EkxarXcAQLl4G4irdfAL16ak/LfaNxqIac=; b=EcXSWC/xr4R3g1MHzufrZHLvicU6tXcpIGY3h37DoFenuk7KTjvzb1tByyl+Vw6x/WlixE rBqB2G4luGee+Pyt1/AyCU6XL6pAIdOqFVEIqX4MkSLy7V+G7OEboFlzm7L4GA8apMvh+p AnMvodt/odWbgvjrJhrMSvbKAPzidXE= X-MC-Unique: 0Gx-2BYsNBucSwbFQRxSRg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 1/9] domain_capabilities: use early return in virDomainCapsFeatureSEVFormat() Date: Wed, 20 Jul 2022 15:11:04 +0200 Message-Id: <8aea3aa9386985fb3d239e4e3be2f4fae477dbef.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322788648100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- src/conf/domain_capabilities.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 33570a51db..bb36a956db 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -590,25 +590,24 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf, { if (!sev) { virBufferAddLit(buf, "\n"); - } else { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - virBufferAsprintf(buf, "%d\n", sev->cbitpos); - virBufferAsprintf(buf, "%d\n", - sev->reduced_phys_bits); - virBufferAsprintf(buf, "%d\n", - sev->max_guests); - virBufferAsprintf(buf, "%d\n", - sev->max_es_guests); - if (sev->cpu0_id !=3D NULL) { - virBufferAsprintf(buf, "%s\n", - sev->cpu0_id); - } - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + return; } =20 - return; + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "%d\n", sev->cbitpos); + virBufferAsprintf(buf, "%d\n", + sev->reduced_phys_bits); + virBufferAsprintf(buf, "%d\n", + sev->max_guests); + virBufferAsprintf(buf, "%d\n", + sev->max_es_guests); + if (sev->cpu0_id !=3D NULL) { + virBufferAsprintf(buf, "%s\n", + sev->cpu0_id); + } + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); } =20 =20 --=20 2.35.3