]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domcaps: Introduce TPM backendVersion
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 12 Jul 2022 13:58:12 +0000 (15:58 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Jul 2022 09:55:06 +0000 (11:55 +0200)
We accept TPM version in the domain XML. However, supported
version depends on the host (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 <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
docs/formatdomaincaps.rst
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h

index 3c425a9a4a1867fc776acdd405e68e8f07dc9570..70f46b972ab89934d3ed863b20907e80ecfc6184 100644 (file)
@@ -513,6 +513,10 @@ TPM device capabilities are exposed under the ``tpm`` element. For instance:
           <value>passthrough</value>
           <value>emulator</value>
         </enum>
+        <enum name='backendVersion'>
+          <value>1.2</value>
+          <value>2.0</value>
+        </enum>
       </tpm>
       ...
     </devices>
@@ -522,6 +526,8 @@ TPM device capabilities are exposed under the ``tpm`` element. For instance:
    Options for the ``model`` attribute of the ``<tpm/>`` element.
 ``backendModel``
    Options for the ``type`` attribute of the ``<tpm><backend/>`` element.
+``backendVersion``
+   Options for the ``version`` attribute of the ``<tpm><backend/>`` element.
 
 Features
 ~~~~~~~~
index 895e8d00e8bcdb6a64b1ecda0ea73ed611d81024..33570a51db8050873469c15315c9898ca69228c4 100644 (file)
@@ -539,6 +539,7 @@ virDomainCapsDeviceTPMFormat(virBuffer *buf,
 
     ENUM_PROCESS(tpm, model, virDomainTPMModelTypeToString);
     ENUM_PROCESS(tpm, backendModel, virDomainTPMBackendTypeToString);
+    ENUM_PROCESS(tpm, backendVersion, virDomainTPMVersionTypeToString);
 
     FORMAT_EPILOGUE(tpm);
 }
index f2eed80b157e52069124995decbc0ad81deeaa8b..a526969cda1880d0979512eece036f34ad9f1bb0 100644 (file)
@@ -127,6 +127,7 @@ struct _virDomainCapsDeviceTPM {
     virTristateBool supported;
     virDomainCapsEnum model;   /* virDomainTPMModel */
     virDomainCapsEnum backendModel;   /* virDomainTPMBackendType */
+    virDomainCapsEnum backendVersion; /* virDomainTPMVersion */
 };
 
 STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST);