From nobody Mon Feb 9 06:50:54 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=1658136903; cv=none; d=zohomail.com; s=zohoarc; b=T5bMr4dKNdWbf1k9/K159c366HZeYw+rZsJnQuJR17LKm0ZpnD/so8gTROaCHyspEpC/XICZQEfR9kvs9eas8Oa9OAn2KeWtNj0Iyx1P0fyU72qI1MHZ5tu531zT16WO3rPnVA5bdvvSt06JdKxL1smiX6Wc3vJYMYCLxGtYOeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658136903; 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=xfm1EqnFRlhy0GW1ZFtvMiLrzAdKqRcR0ecPBvmSD6U=; b=bzMJPiSFG1UF3NFn5aIK1QxvkXrFstNOnCSV4hID+nn8A8ut4kb32VDsqHwsiiJQ+PTnFitSO9MG7ZoZlNtHg44EbeiJJIOKWgFCTImMwAIarM497KstOmAcDoSpngihg5v8Hrh7wbt4VnQptj+pnEI3WZN305bUfh/H+/uXaBc= 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 1658136903341686.8792379173501; Mon, 18 Jul 2022 02:35:03 -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-13-QrffpiUHOJ6LXYygMahmaQ-1; Mon, 18 Jul 2022 05:30:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 187BE80418F; Mon, 18 Jul 2022 09:30:56 +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 A080DC3598D; Mon, 18 Jul 2022 09:30:55 +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 514FF194705E; Mon, 18 Jul 2022 09:30:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 32E821947075 for ; Mon, 18 Jul 2022 09:30:54 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1DD262166B29; Mon, 18 Jul 2022 09:30:54 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE0602166B26 for ; Mon, 18 Jul 2022 09:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658136902; 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=xfm1EqnFRlhy0GW1ZFtvMiLrzAdKqRcR0ecPBvmSD6U=; b=NJp/PtYbQ5lECiuIUamCah/B9rHpPfe2dqxE78gnvIsShBaJ8hRKYexmcAeK7yBA//HuhK pnGL8kuPnCcxTenTNA1BQMQuS4FIjjFLC0fhMup26cIoxzJZhRuuyAB6n+NGKfllpGHSee k7eucHsD7/H/PRwITTLGKLfHIhojOww= X-MC-Unique: QrffpiUHOJ6LXYygMahmaQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/8] conf: Drop needless setting of VIR_DOMAIN_TPM_VERSION_DEFAULT Date: Mon, 18 Jul 2022 11:30:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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.8 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: 1658136903605100001 Content-Type: text/plain; charset="utf-8"; x-default="true" In previous commit the VIR_DOMAIN_TPM_VERSION_DEFAULT value was made just an alias to value of 0. And since all newly allocated memory is zeroed out (due to use of g_new0()), the def->version inside of virDomainTPMDefParseXML() is also 0 and thus there is no need to set it explicitly. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6c178783af..2d8989e4ff 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10397,15 +10397,12 @@ virDomainTPMDefParseXML(virDomainXMLOption *xmlop= t, } =20 version =3D virXMLPropString(backends[0], "version"); - if (!version) { - def->version =3D VIR_DOMAIN_TPM_VERSION_DEFAULT; - } else { - if ((def->version =3D virDomainTPMVersionTypeFromString(version)) = <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unsupported TPM version '%s'"), - version); - goto error; - } + if (version && + (def->version =3D virDomainTPMVersionTypeFromString(version)) <=3D= 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unsupported TPM version '%s'"), + version); + goto error; } =20 switch (def->type) { --=20 2.35.1