mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf, qemu, security, tests: introducing 'def->tpms' array
A TPM Proxy device can coexist with a regular TPM, but the current domain definition supports only a single TPM device in the 'tpm' pointer. This patch replaces this existing pointer in the domain definition to an array of TPM devices. All files that references the old pointer were adapted to handle the new array instead. virDomainDefParseXML() TPM related code was adapted to handle the parsing of an extra TPM device. TPM validations after this new scenario will be updated in the next patch. 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> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
committed by
Ján Tomko
parent
db45fb49e8
commit
19d74fdf0e
@@ -437,12 +437,13 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv,
|
||||
vsockPriv->vhostfd = 6789;
|
||||
}
|
||||
|
||||
if (vm->def->tpm) {
|
||||
if (vm->def->tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR) {
|
||||
VIR_FREE(vm->def->tpm->data.emulator.source.data.file.path);
|
||||
vm->def->tpm->data.emulator.source.data.file.path = g_strdup("/dev/test");
|
||||
vm->def->tpm->data.emulator.source.type = VIR_DOMAIN_CHR_TYPE_FILE;
|
||||
}
|
||||
for (i = 0; i < vm->def->ntpms; i++) {
|
||||
if (vm->def->tpms[i]->type != VIR_DOMAIN_TPM_TYPE_EMULATOR)
|
||||
continue;
|
||||
|
||||
VIR_FREE(vm->def->tpms[i]->data.emulator.source.data.file.path);
|
||||
vm->def->tpms[i]->data.emulator.source.data.file.path = g_strdup("/dev/test");
|
||||
vm->def->tpms[i]->data.emulator.source.type = VIR_DOMAIN_CHR_TYPE_FILE;
|
||||
}
|
||||
|
||||
for (i = 0; i < vm->def->nvideos; i++) {
|
||||
|
||||
Reference in New Issue
Block a user