]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: add validations after TPM Proxy model introduction
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 10 Jun 2020 18:11:48 +0000 (15:11 -0300)
committerJán Tomko <jtomko@redhat.com>
Tue, 23 Jun 2020 15:27:50 +0000 (17:27 +0200)
commit0f7e8649c787ec56f2fbcbeaebe42314ae7a8d8d
tree18d42aa27e8a06b3ea95d225b5b6c961cbbfe7fb
parent19d74fdf0eb5d2e89e80ceedea736425160ffccb
qemu: add validations after TPM Proxy model introduction

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@linux.vnet.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_validate.c