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>
``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.
VIR_DOMAIN_TPM_SOURCE_TYPE_LAST,
"default",
"file",
+ "dir",
);
VIR_ENUM_IMPL(virDomainTPMPcrBank,
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;
<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>
<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'/>