From nobody Sat Feb 7 10:44:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594223054; cv=none; d=zohomail.com; s=zohoarc; b=KGsoDTTRrVsLmJjnKhBW0RjBJcinhoH1nzZIKJ5TV5A15thl/CGLtW0OEboZtAYnSvV8isld1x+WQLhQBBTJtCQRquBp4JmX/3UymmB5Wn1s2fh5woUwRNIdoLfgnfUYg8GTL6xgTWVnmOMAuXKBLmvBQ3iURqh2TPBqzsenUHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594223054; h=Content-Type:Content-Transfer-Encoding:Cc: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=51Y0oWatO4Rq0AQULyTFGCUcxyg1DbRx2+B2BWQ28IE=; b=c2y+Iwqj5pEWLjCuUG8CwZUWj5XQpDdDtrsv1dQWDiYAzDYL1jkLtghbNCTJwhdqVp1t7F3JWtZdvz1SphIXV3li8ZanVgjtML/RSJ/2cppfwygPniK2BGSrpdKEK+d+rQLFkCNZejPCYImtgQ9EjdDD3oGdwaw9FE0FHaoSL0I= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594223054456749.407967059621; Wed, 8 Jul 2020 08:44:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-8u0MdE7xPumsgzeJEFtcIQ-1; Wed, 08 Jul 2020 11:44:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 913521083E84; Wed, 8 Jul 2020 15:44:00 +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 5FC3B106222A; Wed, 8 Jul 2020 15:44:00 +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 295E71809557; Wed, 8 Jul 2020 15:44:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 068Fg7m1000585 for ; Wed, 8 Jul 2020 11:42:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 84A6A20A0522; Wed, 8 Jul 2020 15:42:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5238620A0530 for ; Wed, 8 Jul 2020 15:42:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4D2C8008A5 for ; Wed, 8 Jul 2020 15:42:01 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-LJwWns2eNLK2n5qYf0z-lg-1; Wed, 08 Jul 2020 11:41:55 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 068FY19V163022; Wed, 8 Jul 2020 11:41:54 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com with ESMTP id 325brdjpkd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 11:41:53 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 068FEg3e010962; Wed, 8 Jul 2020 15:40:24 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 324buh1yme-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 15:40:24 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 068FeNV145613430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jul 2020 15:40:23 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58663112063; Wed, 8 Jul 2020 15:40:23 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B882112066; Wed, 8 Jul 2020 15:40:23 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 8 Jul 2020 15:40:23 +0000 (GMT) X-MC-Unique: 8u0MdE7xPumsgzeJEFtcIQ-1 X-MC-Unique: LJwWns2eNLK2n5qYf0z-lg-1 From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v4 1/3] qemu: Move setting of TPM default to post parse function Date: Wed, 8 Jul 2020 11:40:16 -0400 Message-Id: <20200708154018.109736-2-stefanb@linux.vnet.ibm.com> In-Reply-To: <20200708154018.109736-1-stefanb@linux.vnet.ibm.com> References: <20200708154018.109736-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-08_13:2020-07-08, 2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 adultscore=0 cotscore=-2147483648 suspectscore=1 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007080104 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: marcandre.lureau@redhat.com, pkrempa@redhat.com, Stefan Berger 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.84 on 10.5.11.22 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 Content-Type: text/plain; charset="utf-8" From: Stefan Berger Move setting the TPM default version out of the validation function into the post parse function. Signed-off-by: Stefan Berger Reviewed-by: Peter Krempa --- src/qemu/qemu_domain.c | 7 ++++--- src/qemu/qemu_validate.c | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 42cc78ac1b..f916d840e2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4347,12 +4347,13 @@ qemuDomainDefTPMsPostParse(virDomainDefPtr def) virDomainTPMDefPtr regularTPM =3D NULL; size_t i; =20 - if (def->ntpms < 2) - return 0; - for (i =3D 0; i < def->ntpms; i++) { virDomainTPMDefPtr tpm =3D def->tpms[i]; =20 + /* TPM 1.2 and 2 are not compatible, so we choose a specific versi= on here */ + if (tpm->version =3D=3D VIR_DOMAIN_TPM_VERSION_DEFAULT) + tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY) { if (proxyTPM) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index bd7590a00a..d130b52bf2 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3644,10 +3644,6 @@ qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, { virQEMUCapsFlags flag; =20 - /* TPM 1.2 and 2 are not compatible, so we choose a specific version h= ere */ - if (tpm->version =3D=3D VIR_DOMAIN_TPM_VERSION_DEFAULT) - tpm->version =3D VIR_DOMAIN_TPM_VERSION_1_2; - switch (tpm->version) { case VIR_DOMAIN_TPM_VERSION_1_2: /* TPM 1.2 + CRB do not work */ --=20 2.17.1