qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm


From: Valluri, Amarnath
Subject: Re: [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm
Date: Tue, 24 Oct 2017 09:47:46 +0000

On Tue, 2017-10-24 at 08:35 +0200, Juan Quintela wrote:
> Commit
>    c37cacabf2285b0731b44c1f667781fdd4f2b658
> 
> broke compilation without tpm.  Just add an #ifdef
> 
> CC: Amarnath Valluri <address@hidden>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
>  tpm.c | 6 +++++-
>  vl.c  | 2 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tpm.c b/tpm.c
> index 45520f555d..e2f3be2e08 100644
> --- a/tpm.c
> +++ b/tpm.c
> @@ -223,8 +223,11 @@ TPMInfoList *qmp_query_tpm(Error **errp)
>  
>  TpmTypeList *qmp_query_tpm_types(Error **errp)
>  {
> +    TpmTypeList *head = NULL;
> +
> +#ifdef CONFIG_TPM
>      unsigned int i = 0;
> -    TpmTypeList *head = NULL, *prev = NULL, *cur_item;
> +    TpmTypeList *prev = NULL, *cur_item;
>  
>      for (i = 0; i < TPM_TYPE__MAX; i++) {
>          if (!tpm_be_find_by_type(i)) {
> @@ -241,6 +244,7 @@ TpmTypeList *qmp_query_tpm_types(Error **errp)
>          }
>          prev = cur_item;
>      }
> +#endif
>  
>      return head;
>  }
I would prefer to bring everything in tpm.c under #ifdef CONFIG_TPM.
and provide dummy implementations only for qmp commands:
qmp_query_{tpm,_models,_types} in disable-tpm case.

- Amarnath

reply via email to

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