From nobody Thu Apr 25 21:12:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1580745595448715.4305140375914; Mon, 3 Feb 2020 07:59:55 -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-20-gyEzcupdMzerpoCh22JFig-1; Mon, 03 Feb 2020 10:59:52 -0500 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 BC990920E21; Mon, 3 Feb 2020 15:59:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F004100164D; Mon, 3 Feb 2020 15:59:46 +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 4889781743; Mon, 3 Feb 2020 15:59:46 +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 013Fxbb6013437 for ; Mon, 3 Feb 2020 10:59:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 630712037E43; Mon, 3 Feb 2020 15:59:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E0202014E15 for ; Mon, 3 Feb 2020 15:59:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 89D861019290 for ; Mon, 3 Feb 2020 15:59:35 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-243-GyaUDH9EOrSPsXmr1lZ1YQ-1; Mon, 03 Feb 2020 10:59:29 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 013FoRrM070596; Mon, 3 Feb 2020 10:59:27 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xxkn2q0b8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 10:59:27 -0500 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 013Fp38s073215; Mon, 3 Feb 2020 10:59:27 -0500 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xxkn2q0ar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 10:59:27 -0500 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 013FuVXW016580; Mon, 3 Feb 2020 15:59:26 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma04wdc.us.ibm.com with ESMTP id 2xw0y6a1vk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 15:59:25 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 013FxOcn33096088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Feb 2020 15:59:24 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D673D7805E; Mon, 3 Feb 2020 15:59:24 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AED97805C; Mon, 3 Feb 2020 15:59:24 +0000 (GMT) Received: from newfield.pok.ibm.com (unknown [9.47.158.66]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 3 Feb 2020 15:59:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580745594; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc: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=znvrDx2doZ0IK3XFTFSu25oy/JdWnStnSSr8dtjdikk=; b=YM09jEGBhvwQHYqAuobzAu0rGXSb3M/L1XOnp3DEA46B83kb3IyuubWVfMmTi4o++7WP0w EZjx9Ns2Nod0THr71VTPPfmEQYtzAao0/Rrbw6ai0G0yk7dlfHHGLGXLS/ByHcuQvG1p6W 0fYHP5pJ9gOeSpFsNPwDxAUA7JzwMtk= From: Stefan Berger To: libvir-list@redhat.com Subject: [PATCH v2 1/6] conf: Introduce VIR_DOMAIN_TPM_MODEL_DEFAULT as default model Date: Mon, 3 Feb 2020 10:59:16 -0500 Message-Id: <20200203155921.127300-2-stefanb@linux.ibm.com> In-Reply-To: <20200203155921.127300-1-stefanb@linux.ibm.com> References: <20200203155921.127300-1-stefanb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-03_05:2020-02-02, 2020-02-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 suspectscore=1 mlxlogscore=999 clxscore=1015 bulkscore=0 phishscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2002030118 X-MC-Unique: GyaUDH9EOrSPsXmr1lZ1YQ-1 X-MC-Unique: gyEzcupdMzerpoCh22JFig-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 013Fxbb6013437 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.84 on 10.5.11.22 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 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 9b60db7ecd..79aa3e3699 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 e144f3aad3..8b4b0b467a 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 d3045b4bcd..46fd44bbec 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9031,6 +9031,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, @@ -9084,6 +9093,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: @@ -9096,7 +9109,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