qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 24/28] tpm-tis: check that at most one TPM device


From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH v2 24/28] tpm-tis: check that at most one TPM device exists
Date: Mon, 6 Nov 2017 19:39:21 +0100

Signed-off-by: Marc-André Lureau <address@hidden>
---
 hw/tpm/tpm_tis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 175785b9c4..dccc56ab09 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -1057,6 +1057,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",
-- 
2.15.0.rc0.40.gaefcc5f6f




reply via email to

[Prev in Thread] Current Thread [Next in Thread]