conf: Add support for keeping TPM emulator state

Currently, swtpm TPM state file is removed when a transient domain is
powered off or undefined. When we store TPM state on a shared storage
such as NFS and use transient domain, TPM states should be kept as it is.

Add per-TPM emulator option `persistent_sate` for keeping TPM state.
This option only works for the emulator type backend and looks as follows:

  <tpm model='tpm-tis'>
    <backend type='emulator' persistent_state='yes'/>
  </tpm>

Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Eiichi Tsukata
2021-01-06 11:44:12 +01:00
committed by Michal Privoznik
parent f7c40b5c71
commit cc6c49f6cd
10 changed files with 144 additions and 1 deletions
+7
View File
@@ -6986,6 +6986,13 @@ Example: usage of the TPM Emulator
- '1.2' : creates a TPM 1.2
- '2.0' : creates a TPM 2.0
``persistent_state``
The ``persistent_state`` attribute indicates whether 'swtpm' TPM state is
kept or not when a transient domain is powered off or undefined. This
option can be used for preserving TPM state. By default the value is ``no``.
This attribute only works with the ``emulator`` backend. The accepted values
are ``yes`` and ``no``. :since:`Since 7.0.0`
``encryption``
The ``encryption`` element allows the state of a TPM emulator to be
encrypted. The ``secret`` must reference a secret object that holds the
+8
View File
@@ -4766,6 +4766,14 @@
<value>emulator</value>
</attribute>
<ref name="tpm-backend-emulator-encryption"/>
<optional>
<attribute name="persistent_state">
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
</optional>
</group>
</choice>
<choice>