From nobody Sun Feb 8 23:06:13 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=1641284089; cv=none; d=zohomail.com; s=zohoarc; b=V5U1ZV5xNHCPcBdEGZPrWWVJR1ryZbrEtSlWwXU8ef9wwYBMXOzsTEBGFfRFkSfH3jIEN5IRLhk7CpjfKQ+WxoV9Pa/le/cQiHRfkKDhvPoSKytg2SSSPl7wpFli1s+ymSiUy4jAUr9fAhwEpzm3Ed7xd0nGUme7m8nc0Hlbf7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641284089; 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=SbV7jPw5PXdYUNd1bwE1Goa5Z4tYp0UTqeZ+LfzWOkw=; b=X81Zz6+le3/H6SQNLyiR8UoBTu7k71y7rHb6yVbjtdw2V/tNWIniaQusAHcwV8cws+vOgP7sTx3aZFH3Sk2AXy0NfPx/MDDz8pS4UVdZUQFIrGFLWqA+MkyeaSd/omlqHb02vbM4WOj2F3eAw1TL/kBUnpK0aGzuteFEZI3u/aE= 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 1641284089013266.2066392485533; Tue, 4 Jan 2022 00:14:49 -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-53-2AZtYT4TOV6CIzf3W9fb_Q-1; Tue, 04 Jan 2022 03:14:46 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A4DB100D84E; Tue, 4 Jan 2022 08:14:40 +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 7AD986F12F; Tue, 4 Jan 2022 08:14:40 +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 437B11809C87; Tue, 4 Jan 2022 08:14:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 2048EZct027115 for ; Tue, 4 Jan 2022 03:14:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3A60D5ED4D; Tue, 4 Jan 2022 08:14:35 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8E79607AA for ; Tue, 4 Jan 2022 08:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641284088; 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=SbV7jPw5PXdYUNd1bwE1Goa5Z4tYp0UTqeZ+LfzWOkw=; b=HIz5DcZjMLmg910MDm5G263fPju7HDgf22rnhocbfRB2v69YijsLVwwEXyOs2Wq/I/CfYX Ir9aViYNTmtxuiDyticNEiFa1k+mnoBj60IMMWvCWOSDJcH4t0vGKAZH8TYclYYZzw2qXo FPj+A4ima6Lk2MyvbLbKQHynQ1hzB1o= X-MC-Unique: 2AZtYT4TOV6CIzf3W9fb_Q-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] conf: Make virDomainTPMDefFormat() return void Date: Tue, 4 Jan 2022 09:14:30 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.79 on 10.5.11.15 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: 1641284090073100001 Content-Type: text/plain; charset="utf-8" The virDomainTPMDefFormat() function can't fail really. There's no point in it returning an integer then. Make it return void and fix both places which check for its retval. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b8fef8586c..509f74c092 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25476,9 +25476,9 @@ virDomainSoundCodecDefFormat(virBuffer *buf, return 0; } =20 -static int +static void virDomainTPMDefFormat(virBuffer *buf, - virDomainTPMDef *def, + const virDomainTPMDef *def, unsigned int flags) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; @@ -25529,8 +25529,6 @@ virDomainTPMDefFormat(virBuffer *buf, virDomainDeviceInfoFormat(&childBuf, &def->info, flags); =20 virXMLFormatElement(buf, "tpm", &attrBuf, &childBuf); - - return 0; } =20 =20 @@ -28517,8 +28515,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, } =20 for (n =3D 0; n < def->ntpms; n++) { - if (virDomainTPMDefFormat(buf, def->tpms[n], flags) < 0) - return -1; + virDomainTPMDefFormat(buf, def->tpms[n], flags); } =20 for (n =3D 0; n < def->ngraphics; n++) { @@ -29748,7 +29745,8 @@ virDomainDeviceDefCopy(virDomainDeviceDef *src, rc =3D virDomainChrDefFormat(&buf, src->data.chr, flags); break; case VIR_DOMAIN_DEVICE_TPM: - rc =3D virDomainTPMDefFormat(&buf, src->data.tpm, flags); + virDomainTPMDefFormat(&buf, src->data.tpm, flags); + rc =3D 0; break; case VIR_DOMAIN_DEVICE_PANIC: virDomainPanicDefFormat(&buf, src->data.panic); --=20 2.34.1