]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - tpm.c
mac_dbdma: always initialize channel field in DBDMA_channel
[thirdparty/qemu.git] / tpm.c
diff --git a/tpm.c b/tpm.c
index a3f3b7f90fc5bd0bb60d96baaece183a64e50761..f2c59d1f71a27d6fa1ac71b2f3b24fc3b73ebb05 100644 (file)
--- a/tpm.c
+++ b/tpm.c
  */
 #include "config-host.h"
 
-#include "monitor/monitor.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/tpm_backend.h"
 #include "sysemu/tpm.h"
 #include "qemu/config-file.h"
+#include "qemu/error-report.h"
 #include "qmp-commands.h"
 
 static QLIST_HEAD(, TPMBackend) tpm_backends =
@@ -140,21 +140,21 @@ static int configure_tpm(QemuOpts *opts)
 
     id = qemu_opts_id(opts);
     if (id == NULL) {
-        qerror_report(QERR_MISSING_PARAMETER, "id");
+        error_report(QERR_MISSING_PARAMETER, "id");
         return 1;
     }
 
     value = qemu_opt_get(opts, "type");
     if (!value) {
-        qerror_report(QERR_MISSING_PARAMETER, "type");
+        error_report(QERR_MISSING_PARAMETER, "type");
         tpm_display_backend_drivers();
         return 1;
     }
 
     be = tpm_get_backend_driver(value);
     if (be == NULL) {
-        qerror_report(QERR_INVALID_PARAMETER_VALUE, "type",
-                      "a TPM backend type");
+        error_report(QERR_INVALID_PARAMETER_VALUE,
+                     "type", "a TPM backend type");
         tpm_display_backend_drivers();
         return 1;
     }
@@ -228,7 +228,7 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg)
         tpm_display_backend_drivers();
         return -1;
     }
-    opts = qemu_opts_parse(opts_list, optarg, 1);
+    opts = qemu_opts_parse_noisily(opts_list, optarg, true);
     if (!opts) {
         return -1;
     }
@@ -260,9 +260,9 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
 
     switch (drv->ops->type) {
     case TPM_TYPE_PASSTHROUGH:
-        res->options->kind = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
+        res->options->type = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
         tpo = g_new0(TPMPassthroughOptions, 1);
-        res->options->passthrough = tpo;
+        res->options->u.passthrough = tpo;
         if (drv->path) {
             tpo->path = g_strdup(drv->path);
             tpo->has_path = true;