On a Wednesday in 2020, Daniel Henrique Barboza wrote:
Previous patch handled the conversion of def->tpm to the
array def->tpms and the XML parsing logic. This patch handles
the validations needed to ensure the intended behavior.
The existing qemuValidateDomainDeviceDefTPM() function was updated
to guarantee that the VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY model is
exclusive to PPC64 guests and to the VIR_DOMAIN_TPM_TYPE_PASSTHROUGH
backend.
A new function called qemuDomainDefTPMsPostParse() was added to guarantee
that the following combinations in the same domain are valid:
- a single TPM device
- a single TPM Proxy device
- a single TPM + single TPM Proxy devices
And these combinations in the same domain are NOT valid:
- 2 or more TPM devices
- 2 or more TPM Proxy devices
Tested-by: Satheesh Rajendran <sathnaga(a)linux.vnet.ibm.com>
Reviewed-by: Stefan Berger <stefanb(a)linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_domain.c | 37 +++++++++++++++++++++++++++++++++++++
src/qemu/qemu_validate.c | 19 +++++++++++++++++++
2 files changed, 56 insertions(+)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano