]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
schema: add TPM emulator <source type='dir' path='..'>
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 22 Oct 2024 14:15:19 +0000 (18:15 +0400)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 5 Nov 2024 14:25:53 +0000 (15:25 +0100)
Learn to parse a directory for the TPM state.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
docs/formatdomain.rst
src/conf/domain_conf.c
src/conf/domain_conf.h
src/conf/schemas/domaincommon.rng
tests/qemuxmlconfdata/tpm-emulator-tpm2-enc.xml

index c3b9dd16e345dab3cfdb7631813a94cecc64d24b..2437b5f419fd06ebe6143551f33444ecd271350c 100644 (file)
@@ -8199,7 +8199,8 @@ Example: usage of the TPM Emulator
 
    ``type``
       The type of storage. It's possible to provide "file" to utilize a single
-      file or block device where the TPM state will be stored.
+      file or block device where the TPM state will be stored, or "dir" for the
+      directory where the files will be stored.
 
    ``path``
       The path to the TPM state storage.
index 9dd8b6b55decd8c2fbd96e28615337206f5c810d..3a32e50890c2ba163713d20a0489f591adb27df2 100644 (file)
@@ -1326,6 +1326,7 @@ VIR_ENUM_IMPL(virDomainTPMSourceType,
               VIR_DOMAIN_TPM_SOURCE_TYPE_LAST,
               "default",
               "file",
+              "dir",
 );
 
 VIR_ENUM_IMPL(virDomainTPMPcrBank,
index 7a70f6817748a5dfda4e04e2572f2538e76b99ec..45c52107e8ef006db7cfe52c5e825521dae21fb4 100644 (file)
@@ -1466,6 +1466,7 @@ typedef enum {
 typedef enum {
     VIR_DOMAIN_TPM_SOURCE_TYPE_DEFAULT = 0,
     VIR_DOMAIN_TPM_SOURCE_TYPE_FILE,
+    VIR_DOMAIN_TPM_SOURCE_TYPE_DIR,
 
     VIR_DOMAIN_TPM_SOURCE_TYPE_LAST
 } virDomainTPMSourceType;
index 8d91fb0dd6acb01937c8f75549a811741d398edc..8360eeae3f1e93d95b31f0e5cff3cf9262fba0ac 100644 (file)
   <define name="tpm-backend-emulator-source">
     <optional>
       <element name="source">
-        <attribute name="type">
-          <value>file</value>
-        </attribute>
-        <attribute name="path">
-          <ref name="absFilePath"/>
-        </attribute>
+        <choice>
+          <group>
+            <attribute name="type">
+              <value>file</value>
+            </attribute>
+            <attribute name="path">
+              <ref name="absFilePath"/>
+            </attribute>
+          </group>
+          <group>
+            <attribute name="type">
+              <value>dir</value>
+            </attribute>
+            <attribute name="path">
+              <ref name="absDirPath"/>
+            </attribute>
+          </group>
+        </choice>
       </element>
     </optional>
   </define>
index 9c2279b28b4956bcaf5d1eafd5619d20063004f9..e0c657645d97443a39b5fc2c0fa26b97ace0e9f8 100644 (file)
@@ -30,6 +30,7 @@
     <tpm model='tpm-tis'>
       <backend type='emulator' version='2.0'>
         <encryption secret='32ee7e76-2178-47a1-ab7b-269e6e348015'/>
+        <source type='dir' path='/some/dir'/>
       </backend>
     </tpm>
     <audio id='1' type='none'/>