qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 05/42] tpm: replace tpm_get_backend_driver() to


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 05/42] tpm: replace tpm_get_backend_driver() to drop be_drivers
Date: Mon, 9 Oct 2017 22:40:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 10/09/2017 06:55 PM, Marc-André Lureau wrote:
Use tpm_driver_find_by_type() instead.

Signed-off-by: Marc-André Lureau <address@hidden>

Reviewed-by: Stefan Berger <address@hidden>


---
  tpm.c | 11 +++--------
  1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tpm.c b/tpm.c
index 04de8da5fd..ad2ed6a0da 100644
--- a/tpm.c
+++ b/tpm.c
@@ -31,13 +31,6 @@ void tpm_register_model(enum TpmModel model)
      tpm_models[model] = true;
  }
-static const TPMDriverOps *tpm_get_backend_driver(const char *type)
-{
-    int i = qapi_enum_parse(&TpmType_lookup, type, -1, NULL);
-
-    return i >= 0 ? be_drivers[i] : NULL;
-}
-
  #ifdef CONFIG_TPM
void tpm_register_driver(const TPMDriverOps *tdo)
@@ -110,6 +103,7 @@ static int configure_tpm(QemuOpts *opts)
      const TPMDriverOps *be;
      TPMBackend *drv;
      Error *local_err = NULL;
+    int i;
if (!QLIST_EMPTY(&tpm_backends)) {
          error_report("Only one TPM is allowed.");
@@ -129,7 +123,8 @@ static int configure_tpm(QemuOpts *opts)
          return 1;
      }
- be = tpm_get_backend_driver(value);
+    i = qapi_enum_parse(&TpmType_lookup, value, -1, NULL);
+    be = i >= 0 ? tpm_driver_find_by_type(i) : NULL;
      if (be == NULL) {
          error_report(QERR_INVALID_PARAMETER_VALUE,
                       "type", "a TPM backend type");





reply via email to

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