From nobody Sun Feb 8 19:58:56 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=1657635965; cv=none; d=zohomail.com; s=zohoarc; b=JW2+RRpD23+DReZu5ywzSPtl5Jh63SZKkJ0GSltZfMCvxOpq57GYOA94Uyrt6Zuj7wZEvRaHnBL4b9UC/lRZ5K56cxo4n3QJLe4VSrRXcdkiCecgIpKcwcO46Dp4S2Wr0TD8IgXCsq04nLrDeR1eVRjmKqruroTLtZi/qTTdhwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657635965; 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=AzO4aprnC4Angq0sxlw5MzY257RZln58QVsD7B2yFsM=; b=IrtbQSmV7pKSb45w24kgyyBa5DZssJD+0y2mzXLmTyBoEFfELth0R/uaMWZ92AAhdDE6ffLzdje/4vW1dwDoIFRhWebL8I/cxnu3bKHX7DsmTSSNUnJHX/cHr/Z9GySWeamnNOl069wy5qu4jNof+A/38zMLwC2dAkrCIyovvio= 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 165763596532245.28570494455016; Tue, 12 Jul 2022 07:26:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-QbmPydIbM8im7K8ZXOHUcQ-1; Tue, 12 Jul 2022 10:25:59 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DC40296A602; Tue, 12 Jul 2022 14:25: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 4AB25492C3B; Tue, 12 Jul 2022 14:25:56 +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 2F940194705E; Tue, 12 Jul 2022 14:25:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FF50194705F for ; Tue, 12 Jul 2022 14:25:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6D513401E54; Tue, 12 Jul 2022 14:25:52 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18669492C3B for ; Tue, 12 Jul 2022 14:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657635964; 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=AzO4aprnC4Angq0sxlw5MzY257RZln58QVsD7B2yFsM=; b=AgKWpIZnEtDwudRhJgyWEy31kSU29CI0Emf40/pqdu7CTUS8YXkNeQCEK15W9171Yfm1a8 8ZNq2imGOgV7V6pzDEGNLGsHeU6hRK7UxjUn0C0B4Qecc6vZ28F6S+ymiYpPADrykL9+XA Ek9yQ/+Ubff9XX3fUnrUf2DLPFvxgPA= X-MC-Unique: QbmPydIbM8im7K8ZXOHUcQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] domcaps: Introduce TPM backendVersion Date: Tue, 12 Jul 2022 16:25:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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.9 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: 1657635966602100007 Content-Type: text/plain; charset="utf-8"; x-default="true" We accept TPM version in the domain XML. However, supported version depends on the host configuration (swtpm_setup binary) and thus it may be tricky for users (or mgmt applications) chose a version. Introduce machinery for reporting supported version in domain capabilities. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/formatdomaincaps.rst | 6 ++++++ src/conf/domain_capabilities.c | 1 + src/conf/domain_capabilities.h | 1 + 3 files changed, 8 insertions(+) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 384b5eb7ea..a60e610c4c 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -513,6 +513,10 @@ TPM device capabilities are exposed under the ``tpm`` = element. For instance: passthrough emulator + + 1.2 + 2.0 + ... @@ -522,6 +526,8 @@ TPM device capabilities are exposed under the ``tpm`` e= lement. For instance: Options for the ``model`` attribute of the element. ``backendModel`` Options for the ``type`` attribute of the element. +``backendVersion`` + Options for the ``version`` attribute of the element. =20 =20 Features diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 895e8d00e8..33570a51db 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -539,6 +539,7 @@ virDomainCapsDeviceTPMFormat(virBuffer *buf, =20 ENUM_PROCESS(tpm, model, virDomainTPMModelTypeToString); ENUM_PROCESS(tpm, backendModel, virDomainTPMBackendTypeToString); + ENUM_PROCESS(tpm, backendVersion, virDomainTPMVersionTypeToString); =20 FORMAT_EPILOGUE(tpm); } diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index f2eed80b15..a526969cda 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -127,6 +127,7 @@ struct _virDomainCapsDeviceTPM { virTristateBool supported; virDomainCapsEnum model; /* virDomainTPMModel */ virDomainCapsEnum backendModel; /* virDomainTPMBackendType */ + virDomainCapsEnum backendVersion; /* virDomainTPMVersion */ }; =20 STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); --=20 2.35.1