* [Qemu-devel] [PATCH v2] Fix compile with --disable-tpm
@ 2017-10-23 10:24 BALATON Zoltan
2017-10-23 13:53 ` Stefan Berger
0 siblings, 1 reply; 2+ messages in thread
From: BALATON Zoltan @ 2017-10-23 10:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Berger, Paolo Bonzini, Philippe Mathieu-Daude
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
tpm.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/tpm.c b/tpm.c
index 45520f5..ed78ead 100644
--- a/tpm.c
+++ b/tpm.c
@@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model)
tpm_models[model] = true;
}
-#ifdef CONFIG_TPM
-
static const TPMBackendClass *
tpm_be_find_by_type(enum TpmType type)
{
@@ -48,6 +46,8 @@ tpm_be_find_by_type(enum TpmType type)
return TPM_BACKEND_CLASS(oc);
}
+#ifdef CONFIG_TPM
+
/*
* Walk the list of available TPM backend drivers and display them on the
* screen.
@@ -146,20 +146,6 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
}
/*
- * Walk the list of TPM backend drivers that are in use and call their
- * destroy function to have them cleaned up.
- */
-void tpm_cleanup(void)
-{
- TPMBackend *drv, *next;
-
- QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) {
- QLIST_REMOVE(drv, list);
- object_unref(OBJECT(drv));
- }
-}
-
-/*
* Initialize the TPM. Process the tpmdev command line options describing the
* TPM backend.
*/
@@ -195,6 +181,20 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg)
#endif /* CONFIG_TPM */
/*
+ * Walk the list of TPM backend drivers that are in use and call their
+ * destroy function to have them cleaned up.
+ */
+void tpm_cleanup(void)
+{
+ TPMBackend *drv, *next;
+
+ QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) {
+ QLIST_REMOVE(drv, list);
+ object_unref(OBJECT(drv));
+ }
+}
+
+/*
* Walk the list of active TPM backends and collect information about them
* following the schema description in qapi-schema.json.
*/
@@ -208,8 +208,9 @@ TPMInfoList *qmp_query_tpm(Error **errp)
continue;
}
info = g_new0(TPMInfoList, 1);
+#ifdef CONFIG_TPM
info->value = tpm_backend_query_tpm(drv);
-
+#endif
if (!cur_item) {
head = cur_item = info;
} else {
--
2.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Qemu-devel] [PATCH v2] Fix compile with --disable-tpm
2017-10-23 10:24 [Qemu-devel] [PATCH v2] Fix compile with --disable-tpm BALATON Zoltan
@ 2017-10-23 13:53 ` Stefan Berger
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Berger @ 2017-10-23 13:53 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel; +Cc: Paolo Bonzini, Philippe Mathieu-Daude
On 10/23/2017 06:24 AM, BALATON Zoltan wrote:
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> ---
> tpm.c | 35 ++++++++++++++++++-----------------
> 1 file changed, 18 insertions(+), 17 deletions(-)
>
> diff --git a/tpm.c b/tpm.c
> index 45520f5..ed78ead 100644
> --- a/tpm.c
> +++ b/tpm.c
> @@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model)
> tpm_models[model] = true;
> }
>
> -#ifdef CONFIG_TPM
> -
> static const TPMBackendClass *
> tpm_be_find_by_type(enum TpmType type)
> {
> @@ -48,6 +46,8 @@ tpm_be_find_by_type(enum TpmType type)
> return TPM_BACKEND_CLASS(oc);
> }
>
> +#ifdef CONFIG_TPM
> +
> /*
> * Walk the list of available TPM backend drivers and display them on the
> * screen.
> @@ -146,20 +146,6 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
> }
>
> /*
> - * Walk the list of TPM backend drivers that are in use and call their
> - * destroy function to have them cleaned up.
> - */
> -void tpm_cleanup(void)
> -{
> - TPMBackend *drv, *next;
> -
> - QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) {
> - QLIST_REMOVE(drv, list);
> - object_unref(OBJECT(drv));
> - }
> -}
> -
> -/*
> * Initialize the TPM. Process the tpmdev command line options describing the
> * TPM backend.
> */
> @@ -195,6 +181,20 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg)
> #endif /* CONFIG_TPM */
>
> /*
> + * Walk the list of TPM backend drivers that are in use and call their
> + * destroy function to have them cleaned up.
> + */
> +void tpm_cleanup(void)
> +{
> + TPMBackend *drv, *next;
> +
> + QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) {
> + QLIST_REMOVE(drv, list);
> + object_unref(OBJECT(drv));
> + }
> +}
> +
> +/*
> * Walk the list of active TPM backends and collect information about them
> * following the schema description in qapi-schema.json.
> */
> @@ -208,8 +208,9 @@ TPMInfoList *qmp_query_tpm(Error **errp)
> continue;
> }
> info = g_new0(TPMInfoList, 1);
> +#ifdef CONFIG_TPM
> info->value = tpm_backend_query_tpm(drv);
> -
> +#endif
> if (!cur_item) {
> head = cur_item = info;
> } else {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-23 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 10:24 [Qemu-devel] [PATCH v2] Fix compile with --disable-tpm BALATON Zoltan
2017-10-23 13:53 ` Stefan Berger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).