From nobody Sun Feb 8 10:33:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580927773651898.0972956409774; Wed, 5 Feb 2020 10:36:13 -0800 (PST) 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-331-HXsvOuBDOqawDf55YjS1oQ-1; Wed, 05 Feb 2020 13:36:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5678D1084420; Wed, 5 Feb 2020 18:36:04 +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 EAC408DC00; Wed, 5 Feb 2020 18:36:03 +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 6662518089CD; Wed, 5 Feb 2020 18:36:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 015Ia0LO018633 for ; Wed, 5 Feb 2020 13:36:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6EC892166B2A; Wed, 5 Feb 2020 18:36:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69F662166B29 for ; Wed, 5 Feb 2020 18:35:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 C999418AE956 for ; Wed, 5 Feb 2020 18:35:57 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-uNTZ3mINNE2N5HmVfvdsoQ-1; Wed, 05 Feb 2020 13:35:55 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 015IRZLr050306; Wed, 5 Feb 2020 13:35:55 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xyhnrpudm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Feb 2020 13:35:54 -0500 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 015IRsc7051367; Wed, 5 Feb 2020 13:35:54 -0500 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xyhnrpudf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Feb 2020 13:35:54 -0500 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 015IUH4W026663; Wed, 5 Feb 2020 18:35:54 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma01wdc.us.ibm.com with ESMTP id 2xykc9esry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Feb 2020 18:35:54 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 015IZrQe52494754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Feb 2020 18:35:53 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 98A2DB205F; Wed, 5 Feb 2020 18:35:53 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81C71B2065; Wed, 5 Feb 2020 18:35:53 +0000 (GMT) Received: from newfield.pok.ibm.com (unknown [9.47.158.66]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 5 Feb 2020 18:35:53 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580927772; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=WJtlFPUUDKBOPO2Mc2e1YBr3556U0n374u6E5Jn+1z4=; b=TkcngbyF7yPe8lEJJDbXxZRtJZhFIKEaNuiR50FAaWYG1bGo6c31yH5eS+6FfX5Rx7U0PJ zn/UILoFWxUh3/miM+RKnZUiqZAb2q7piNa4d1BUZSV8tG37yuZLgWOyg+IapzM31CWtl2 alcj5yoiqta8uBMVsoGAgnjMeoCFpSk= From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v3 1/6] conf: Introduce VIR_DOMAIN_TPM_MODEL_DEFAULT as default model Date: Wed, 5 Feb 2020 13:35:45 -0500 Message-Id: <20200205183550.127753-2-stefanb@linux.ibm.com> In-Reply-To: <20200205183550.127753-1-stefanb@linux.ibm.com> References: <20200205183550.127753-1-stefanb@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-05_06:2020-02-04, 2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 adultscore=0 suspectscore=1 lowpriorityscore=0 clxscore=1015 impostorscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002050140 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id 015IRZLr050306 X-MC-Unique: uNTZ3mINNE2N5HmVfvdsoQ-1 X-MC-Unique: HXsvOuBDOqawDf55YjS1oQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 015Ia0LO018633 X-loop: libvir-list@redhat.com Cc: aik@ozlabs.ru, marcandre.lureau@redhat.com, Stefan Berger , jtomko@redhat.com, david@gibson.dropbear.id.au 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.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Introduce VIR_DOMAIN_TPM_MODEL_DEFAULT as a default model which we use in case the user does not provide a model in the device XML. It has the TIS's previous value of '0'. In the post parsing function we change this default value to 'TIS' to have the same model as before. Signed-off-by: Stefan Berger Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain.c | 14 +++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c7cc830c1d..040643e78f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1125,6 +1125,7 @@ VIR_ENUM_IMPL(virDomainRNGBackend, =20 VIR_ENUM_IMPL(virDomainTPMModel, VIR_DOMAIN_TPM_MODEL_LAST, + "default", "tpm-tis", "tpm-crb", ); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 2bd80c2fbf..cb4a0cedf0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1252,6 +1252,7 @@ struct _virDomainHubDef { }; =20 typedef enum { + VIR_DOMAIN_TPM_MODEL_DEFAULT, VIR_DOMAIN_TPM_MODEL_TIS, VIR_DOMAIN_TPM_MODEL_CRB, =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6ebee4d5f4..e152448cc6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9035,6 +9035,15 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr= hostdev, } =20 =20 +static int +qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm) +{ + if (tpm->model =3D=3D VIR_DOMAIN_TPM_MODEL_DEFAULT) + tpm->model =3D VIR_DOMAIN_TPM_MODEL_TIS; + return 0; +} + + static int qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, const virDomainDef *def, @@ -9088,6 +9097,10 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr d= ev, ret =3D qemuDomainHostdevDefPostParse(dev->data.hostdev, qemuCaps); break; =20 + case VIR_DOMAIN_DEVICE_TPM: + ret =3D qemuDomainTPMDefPostParse(dev->data.tpm); + break; + case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_INPUT: @@ -9100,7 +9113,6 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, case VIR_DOMAIN_DEVICE_MEMBALLOON: case VIR_DOMAIN_DEVICE_NVRAM: case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_TPM: case VIR_DOMAIN_DEVICE_MEMORY: case VIR_DOMAIN_DEVICE_IOMMU: ret =3D 0; --=20 2.17.1