schema: add TPM emulator <source type='dir' path='..'>

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>
This commit is contained in:
Marc-André Lureau 2024-10-22 18:15:19 +04:00 committed by Martin Kletzander
parent 579fd44612
commit a110042d0c
5 changed files with 23 additions and 7 deletions

View 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.

View File

@ -1326,6 +1326,7 @@ VIR_ENUM_IMPL(virDomainTPMSourceType,
VIR_DOMAIN_TPM_SOURCE_TYPE_LAST,
"default",
"file",
"dir",
);
VIR_ENUM_IMPL(virDomainTPMPcrBank,

View 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;

View File

@ -5985,12 +5985,24 @@
<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>

View 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'/>