tpm-tis: check that at most one TPM device exists

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Marc-André Lureau 2017-11-06 19:39:21 +01:00 committed by Stefan Berger
parent c87b35fa71
commit 51a837e908

View File

@ -1061,6 +1061,11 @@ static void tpm_tis_realizefn(DeviceState *dev, Error **errp)
{
TPMState *s = TPM(dev);
if (!tpm_find()) {
error_setg(errp, "at most one TPM device is permitted");
return;
}
s->be_driver = qemu_find_tpm_be(s->backend);
if (!s->be_driver) {
error_setg(errp, "backend driver with id %s could not be found",